apache - If No File, Rewrite URL -
I have two .htaccess files that I need to combine in one.
The first one does a simple file extension remover
In order to keep the second URL, it rewrites all the requests to go to the third party's app.
What do I need, the rules are not enough to be smart, to see on other servers if the file is present at first
Rule1:.!
RewriteCond% {REQUEST_FILENAME} at RewriteEngine -dRewriteCond% {REQUEST_FILENAME} \ php -f RewriteRule ^ (*.) $ $ 1.php
Rule 2: (. *)
Option + FollowSymLinks + Index RewriteRule RewriteEngine Current ^ $ http://third.party.com/$1 [P] #RewriteCond% {THE_REQUEST} ([^ ? \]) #RewriteRule ^. * $ Index.php /% 1
I am away from an .htaccess wizard, so I have all the ears for suggestions.
You can add the L flag to stop typing on a given rule. for example:.
RewriteCond% {REQUEST_FILENAME} on RewriteEngine -dRewriteCond% {REQUEST_FILENAME} \ -f php RewriteRule ^ $ $ 1.php [L] RewriteRule ^ ((*.). *) $ Http : //third.party.com/$1 [P] #RewriteCond% {THE_REQUEST} ([^? \]) #RewriteRule ^. * $ Index.php /% 1
(see "Stop the rewrite process").
Comments
Post a Comment