开发者

Apache mod_rewrite, redirect to an URL when a file with a particular extension is requested

开发者 https://www.devze.com 2022-12-16 02:59 出处:网络
I would like to use mod_rewrite to transfo开发者_运维百科rm a URL like this one: http://example.com/qxs/app/myapp.qxs

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.

0

精彩评论

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

关注公众号