阿帕奇.httaccess重写重写、阿帕奇、httaccess

2023-09-02 10:10:09 作者:泪在流心在痛

所以..这就是我想要获得了这幅。

so .. this is what I want to acheive.

我想改写这个网址 http://example.com?page=something 这 http://example.com/something

i want to rewrite this url http://example.com?page=something to this http://example.com/something

这样我可以$ _GET无论是在URL后 $ _GET [页] ='东西'

such that i can $_GET whatever is after the url $_GET['page']= 'something'

我所读过的表演像HTTP教程://example.com/page /某事 所以我在想,如果有可能没有额外的/

all the tutorials I've read show it like http: //example.com/page /something so i was wondering if it is possible without the extra "/"

//更新

这是我对the.httaccess文件

this is what i have on the.httaccess file

RewriteEngine叙述上 重写规则^(。*)/ $的index.php?网页= $ 1 [L]

RewriteEngine on RewriteRule ^(.*)/?$ index.php?page=$1 [L]

但是当我做了回声($ _ GET ['页']);我得到的index.php

but when i do a echo($_GET['page'] ); i get index.php

推荐答案

它需要接受虽然

RewriteRule ^(.*)/?$ index.php?page=$1 [L]