开发者

Mod rewrite question (really a regex problem)

Ive started out with the most basic rewrite there is, take any request and give it to my index page:

RewriteEngine On
RewriteRule ^.*$ index.php [L,QSA]

Im trying to change it now so lets say i have a directory called special, I actually want to be able to go to h开发者_JAVA技巧ttp://example.com/special and access whatever files are in there.

I tried this:

RewriteRule ^special/.*$ index.php [L, QSA]

but it didnt work.


Try either this:

RewriteRule !^special/ index.php [L]

Or this:

RewriteRule ^special/ - [L]
RewriteRule ^ index.php [L]


If you want this to apply to any directory, try this:

RewriteEngine On
RewriteCond %{REQUESTFILENAME}!-d 
RewriteRule ^ index.php [L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜