Hi I want / and index.php to go index.php page everything other than that go to shop.php but everything is going to shop.php Here is expressing i am using. RewriteEngine on RewriteRule ^/ index.php RewriteRule ^[a-zA-Z]([a-zA-Z.]+) shop.php Code (text):
RewriteEngine on RewriteBase / RewriteRule ^/?(index\.php)?$ index.php [L] RewriteRule . shop.php [R=301,L] Code (markup): Try that
it's working fine for / and index.php but not for everything else it says "The page isn't redirecting properly"
RewriteEngine on RewriteBase / RewriteRule ^/?(index\.php)?$ index.php [L] RewriteRule ^[a-zA-Z]([a-zA-Z.]+) shop.php this is working fine now problem at all now I just wanted to know what does [L] Means? and what does [R=301,L] means? Thank you dizyn
[L] means it's the last instruction, and no other rules are checked R=301 means redirect with a 301 HTTP header Try this instead RewriteEngine on RewriteBase / RewriteRule ^/?(index\.php)?$ index.php [L] RewriteCond %{REQUEST_URI} !^/?shop\.php$ RewriteRule . shop.php [R=301,L] Code (markup):
RewriteRule . shop.php [R=301,L] PHP: what's the . supposed to mean here - doesn't it mean 'any single character' (in general)? i would have expected RewriteRule (.*) shop.php [R=301,L] PHP: - just my thoughts.
The first rewrite rule is to see if there is no URI or index.php as the URI. The second checks that the current URI isn't shop.php and then if it isn't it will match against any single character of a uri (and since the blank uri has already been accounted for by the previous rewrite rule it will always match) and rewrite to shop.php