Apache mod_rewrite, redirect to an URL when a file with a particular extension is requested
I would like to use mod_rewrite to transfo开发者_运维百科rm a URL like this one:
http://example.com/qxs/app/myapp.qxs
into
http://example.com/qxs/index.php?page=myapp
Currently I have this:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^app/([^/\.]+).qxs /qxs/index.php?page=$1 [L]
But this ends up in an endless loop or something causing my PHP to report that the memory has exceeded and so on...
What am I doing wrong?
Thank you!
Morten
Try this rule:
RewriteRule ^app/([^/.]+)\.qxs$ qxs/index.php?page=$1 [L]
If PHP is complaining then your RewriteRule has hit the server and the problem probably lies in the PHP code.
精彩评论