开发者

Use .htaccess to change the url PHP sees

I want to use htaccess to not only choose the script that processes the request, but also to change the request uri as php sees it. Can this be 开发者_如何转开发done?

For example:

RewriteRule /funstuff/ funstuff.php

...How can I change that RewriteRule or otherwise change my .htaccess file to get funstuff.php to think that the original request url was actually http://www.example.com/funstuff.php and not http://www.example.com/funstuff/?


The best I can see is

$_SERVER["SCRIPT_NAME"] or $_SERVER["PHP_SELF"]

(Both should be fine) in conjunction with

$_SERVER["QUERY_STRING"]

to get the full request. There seems to be no ready-made REQUEST_URI for this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜