开发者

Apache mod_rewrite help?

I want to rewrite requests like:

mydomain.com/this/is/a/test

to:

mydomain.com/url.php?i=this,is,a,t开发者_JAVA技巧est

How can I write a rule that can handle this?


Create a .htaccess file with the below contents and place it in your root web directory.

RewriteEngine On
Options +Followsymlinks

RewriteRule (.*) url.php?i=$1

That would create a query string of this/is/a/test instead of your requested comma-separated value; that's nothing a quick string-replace function (like str_replace() in PHP) couldn't fix.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜