Zen Cart Logo
Forums / General Questions / redirect query string eg domain/index.php?main_page=index&cPath=106

redirect query string eg domain/index.php?main_page=index&cPath=106

Locked

Views: 11,802

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
25 Oct 2007, 11:55 PM
#1
wolfsz avatar

wolfsz

Zen Follower

Join Date:
Mar 2006
Location:
Australia
Posts:
286
Plugin Contributions:
3

redirect query string eg domain/index.php?main_page=index&cPath=106

Hi guys
I had to work this out and it took me a while and there's nothing in the forums to date. So here is the issue and solution.
Issue is that you want to redirect a URL like this:
"http://www.bluewolf.net.au/zencart/index.php?main_page=index&cPath=257" to one like this
"http://www.bwcommercial.com.au/index.php?main_page=index&cPath=6"

A normal redirect will drop everything after the ? being the query string.

To achieve this edit your .htaccess and insert:```
RewriteEngine on
RewriteCond %{query_string} ^main_page=index&cPath=257
RewriteRule ^zencart/index.php$ http://bwcommercial.com.au/index.php?main_page=index&cPath=6 [R=301,L]