I've set up a set of conditions & rules for a new website & I've found myself needing to combine rules that are in conflict.
## STRIP UNWANTED QUERY STRINGS FROM ALL BUT EXEMPTED FILES ##
RewriteCond %{query_string} .
RewriteCond %{THE_REQUEST} !^.*\/item\.php?(.*)
RewriteCond %{THE_REQUEST} !^.*\/free_item\.php?(.*)
RewriteRule (.*) /$1? [R=301,L]
## PRETTY URLS FOR DYNAMIC PAGES V2 ##
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9]+)$ item.php?font=$1
RewriteRule ^([a-zA-Z0-9]+)/$ item.php?font=$1
Each of these works fine on their own & both play nice with all the other rules in the file. I'm a bit stumped as to why there is a conflict.
When these 2 are used together I get http://example.com/item.php with no parameter.
Looks like the first bit is stripping the query even though the file is exempted.
Any help would be greatly appreciated.
## STRIP UNWANTED QUERY STRINGS FROM ALL BUT EXEMPTED FILES ##
RewriteCond %{query_string} .
RewriteCond %{THE_REQUEST} !^.*\/item\.php?(.*)
RewriteCond %{THE_REQUEST} !^.*\/free_item\.php?(.*)
RewriteRule (.*) /$1? [R=301,L]
## PRETTY URLS FOR DYNAMIC PAGES V2 ##
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9]+)$ item.php?font=$1
RewriteRule ^([a-zA-Z0-9]+)/$ item.php?font=$1
Each of these works fine on their own & both play nice with all the other rules in the file. I'm a bit stumped as to why there is a conflict.
When these 2 are used together I get http://example.com/item.php with no parameter.
Looks like the first bit is stripping the query even though the file is exempted.
Any help would be greatly appreciated.