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]
精彩评论