replace %26 with &
4 posts
• Page 1 of 1
replace %26 with &
There are some other sites that link to mine and use %26 in the link instead of &. I need a URL rewrite to convert any %26 in the URL to a &.
an example is mysite.com/vacation.asp?AmentID=85%26State=Hawaii
I want it to become
mysite.com/vacation.asp?AmentID=85&State=Hawaii
an example is mysite.com/vacation.asp?AmentID=85%26State=Hawaii
I want it to become
mysite.com/vacation.asp?AmentID=85&State=Hawaii
Re: replace %26 with &
Please try to use the following config:
RewriteCond %{QUERY_STRING} ^(.+?)\%26(.*)$ [NC]
RewriteRule .? %{REQUEST_URI}\?%1&%2 [LP,L]
RewriteCond %{QUERY_STRING} ^(.+?)\%26(.*)$ [NC]
RewriteRule .? %{REQUEST_URI}\?%1&%2 [LP,L]
Re: replace %26 with &
thank you for the response, but I go to
mysite.com/vacation.asp?AmentID=85%26State=Hawaii
and nothing happens. It just stays as /vacation.asp?AmentID=85%26State=Hawaii
my httd.ini file is quite large and I've used it for a very long time as is until this latest change.
here is the first part and where I put the new code:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Block external access to the httpd.ini and httpd.parse.errors files
RewriteRule /httpd(?:\.ini|\.parse\.errors).* / [F,I,O]
# Block external access to the Helper ISAPI Extension
RewriteRule .*\.isrwhlp / [F,I,O]
# fix URLs that have %26 instead of &
RewriteCond %{QUERY_STRING} ^(.+?)\%26(.*)$ [NC]
RewriteRule .? %{REQUEST_URI}\?%1&%2 [LP,L]
# minivacs
RewriteRule /vacation-packages/([^/]+)/([^/]+) /vacation-packages/minivacs.asp\?state=$1&city=$2 [I,L]
RewriteRule /vacation-packages/([^/]+)/([^/]+)/ /vacation-packages/minivacs.asp\?state=$1&city=$2 [I,L]
etc. much more after this.
mysite.com/vacation.asp?AmentID=85%26State=Hawaii
and nothing happens. It just stays as /vacation.asp?AmentID=85%26State=Hawaii
my httd.ini file is quite large and I've used it for a very long time as is until this latest change.
here is the first part and where I put the new code:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Block external access to the httpd.ini and httpd.parse.errors files
RewriteRule /httpd(?:\.ini|\.parse\.errors).* / [F,I,O]
# Block external access to the Helper ISAPI Extension
RewriteRule .*\.isrwhlp / [F,I,O]
# fix URLs that have %26 instead of &
RewriteCond %{QUERY_STRING} ^(.+?)\%26(.*)$ [NC]
RewriteRule .? %{REQUEST_URI}\?%1&%2 [LP,L]
# minivacs
RewriteRule /vacation-packages/([^/]+)/([^/]+) /vacation-packages/minivacs.asp\?state=$1&city=$2 [I,L]
RewriteRule /vacation-packages/([^/]+)/([^/]+)/ /vacation-packages/minivacs.asp\?state=$1&city=$2 [I,L]
etc. much more after this.
Re: replace %26 with &
I'm sorry, I've confused v2 and v3 syntax... Here's the rule for v2:
RewriteRule (.*?)\?(.+?)\%26(.*) $1\?$2&$3 [NS,L]
RewriteRule (.*?)\?(.+?)\%26(.*) $1\?$2&$3 [NS,L]
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests