tags:

views:

49

answers:

1

I have URLs that are generated as http://www.domainname.com/about?layout=item I would like to find out how to remove the ?layout=item and also ?layout=category

Any help would be much appreciated

+1  A: 

Following assumes that there is either layout=item or layout=category (not both at the same time)

RewriteCond %{QUERY_STRING} !^$
RewriteCond %{QUERY_STRING} ^(.*)(?<=&|^)layout=(item|category)&?(.*)$.
RewriteRule .* $1?%1%3
Kamil Szot
Thanks for that, unfortunately it has not made any difference at all.
K2Joom
Maybe your problem lies elsewhere. Maybe you have to many strange rules for your mod_rewrite. This can lead to 500 errors. Try to use RewriteLog an RewriteLogLevel to find out what mod_rewrite actually does when you feed it with your urls.
Kamil Szot
Thanks Kamil, When adding in the rule, it does not remove the ?layout, but also alters the url for all other links.I have never used the RewriteLog etc, so I will do some research on how to use them.
K2Joom