The above rule is not working for me.
Here is the htaccess that I have,
-
# Customized error messages.
-
ErrorDocument 404 /index.php
-
-
# Set the default handler.
-
DirectoryIndex index.php
-
-
# Various rewrite rules.
-
<IfModule mod_rewrite.c>
-
RewriteEngine on
-
RewriteCond %{REQUEST_FILENAME} !-f
-
RewriteCond %{REQUEST_FILENAME} !-d
-
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
-
-
RewriteRule ([^?]+)\?.+ $1
-
#RewriteRule ^(.*)/(.*)/1?gclid=(.*)$ customer/city/1/ [L,QSA]
-
#RewriteRule ^(.*)/(.*)/2?gclid=(.*)$ customer/city/2/ [L,QSA]
-
-
</IfModule>
-
This Rule works OK if I have only one destination page for the redirect. But, I have to redirect based on the query string e.g.
http://mysite.com/customer/city/2?gclid=adk131kh231k23h
then I will be redirected to
http://mysite.com/
Even If the url is
http://mysite.com/customer/city/1?gclid=K12K3HKH123K
i will be redirected to
http://mysite.com/
The RewriteRules I need are for following URL scenarious,
If City = 1
http://www.mysite.com/customer/city/...k12j1b32l12lj3
I want to be redirected to city 1 i.e.
http://www.mysite.com/customer/city/1
If City = 2
http://www.mysite.com/customer/city/...k12j1b32l12lj3
I want to be redirected to city 2 i.e.
http://www.mysite.com/customer/city/2
I have written the rules for them, but they doesnt seem to work correctly as they redirect me alwyas to
http://mysite.com
Here are these,
-
#RewriteRule ^(.*)/(.*)/1?gclid=(.*)$ customer/city/1/ [L,QSA]
-
#RewriteRule ^(.*)/(.*)/2?gclid=(.*)$ customer/city/2/ [L,QSA]
Any help would be appreciated.
-