So, I have a site which currently has urls like this: /?s=page&foo1=bar&foo2=bar&foo3=bar and I would want them to display like this: /page?foo1=bar&foo2=bar&foo3=bar S defines the current page and other variables define other things on different pages. Can you give me some advice how to do this in .htaccess-file? I'm not very experienced with Apache's mod_rewrite so if you can go easy on me, all help will be appreciated. Thanks to all already in advance.
RewriteCond %{QUERY_STRING} ^s=page&foo1=bar&foo2=bar&foo3=bar$ ReWriteRule $ /page?foo1=bar&foo2=bar&foo3=bar Please check if it works...
Thanks for the assistance, have one more question, though. Page-part and those bar-variables change as user requests from a php script so it has to be dynamically changeable also in htaccess. How do I do this?
Try this code and see if it works. RewriteCond %{QUERY_STRING} ^s=page&foo1=bar&foo2=bar&foo3=bar$ ReWriteRule $ /page?foo1=bar&foo2=bar&foo3=bar Or Try this one.... RewriteCond %{QUERY_STRING} ^s=page&([^/\.]+)([0-9]+)=bar&([^/\.]+)([0-9]+)=bar&([^/\.]+)([0-9]+)=bar$ ReWriteRule $ /page?$1=bar&$2=bar&$3=bar Even I'm learning so lets see if it works.