I'm trying to achieve this with mod rewrite:
If a user visits mysite.com/app/[somepage].php
, they will see mysite.php/[somepage].php
If a user visits mysite.com/[somepage].php
, they will be rewritten to mysite.com/test.php
The value in square brackets are arbitrary.
This is what I have now:
RewriteRule ^app/(.+) $1 [NC,L]
RewriteRule ^(.+) test.php [NC,L]
However, both mysite.com/app/index.php
and mysite.com/index.php
will rewrite to mysite.com/test.php
. It is as if the last rule is always processed. What is the correct way to achieve this?
Any help would be appreciated.