I've had a look at a few mod_rewrite questions here but nothing they have suggested has worked to date.
I have the below rules:
Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301] RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^-]*)/$ ?action=$1 [L] ## General Pages RewriteRule ^privacy-policy/$ ?action=privacy-policy [L] RewriteRule ^terms-conditions/$ ?action=terms-conditions [L] RewriteRule ^about/$ ?action=about [L] RewriteRule ^contact-us/$ ?action=contact-us [L] RewriteRule ^sitemap.xml$ ?action=sitemap [L] ## Blog Pages RewriteRule ^blog/$ ?action=blog [L] RewriteRule ^blog/([a-zA-Z0-9-]+)/$ ?action=blog&category=$1 [L] RewriteRule ^blog/([a-zA-Z0-9-]+)/([0-9]+)-([a-zA-Z0-9-]+)/$ ?action=blog&category=$1&id=$2&title=$3 [L] The first blog rule works fine and the third blog rule works fine.
The second blog rule isn't working correctly, lets say I have the below URL:
/blog/general/ The second blog rule is returning blog/general as the value for categorywhich is incorrect, it should only be returning general as the value for category.
This issue only occurs on my production environment, it doesn't happen on my local dev environment.
I'm really stumped on this one, any suggestions greatly appreciated.