this is my htaccess file :
<IfModule mod_rewrite.c>
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^getlastversion(.*)$ /lastversion.php$1 [R=301,NC,L,QSA]
# this is temporary and should be removed
RewriteRule ^(.*)$ http://example.com?$1 [R=301,NC,L,QSA]
</IfModule>
browsing mysite.com/getlastversion
redirect to example.com?lastversion.php
(second rule),whereas i need it to be redirected to /lastversion.php
(first rule)
2
Answers
You may try this rule with a negative lookahead condition:
(?!lastversion.php)
is negative lookahead that will skip this rule if we have/lastversion.php
at the start of the URL.Make sure to test this rule after fully clearing your browser cache.
Based on your shown samples, could you please try following. Please make sure to clear your cache before testing your URLs.