Mapfile without QueryString
5 posts
• Page 1 of 1
Mapfile without QueryString
Hi
i'm using a map file to redirect some old url's to new ones.
I have it more or less working, apart from one issue.
Here is my httd.conf
Map file:
If the incoming url is matched it is appending the querystring.... so i get this
shop.domain.co.uk/shop.asp/menswear-clothing?WT.ac=956
How can I stop querystring being appended?
i'm using a map file to redirect some old url's to new ones.
I have it more or less working, apart from one issue.
Here is my httd.conf
- Code: Select all
RewriteMap mapfilet txt:d:\ISAPI_Rewrite3\tele.txt [NC]
RewriteCond %{HTTP:HOST} .*domain.co.uk
RewriteCond ${mapfilet:$1|NOT_FOUND} !NOT_FOUND
RewriteRule (.*) http://shop.domain.co.uk/${mapfilet:$1} [NC,R=301,L]
Map file:
- Code: Select all
abc/def/ghi/?WT.ac=956 shop.asp/menswear-clothing
If the incoming url is matched it is appending the querystring.... so i get this
shop.domain.co.uk/shop.asp/menswear-clothing?WT.ac=956
How can I stop querystring being appended?
Re: Mapfile without QueryString
"How can I stop querystring being appended?"
- you need to put the question mark at the end of substitution string:
RewriteRule (.*) http://shop.domain.co.uk/${mapfilet:$1}? [NC,R=301,L]
- you need to put the question mark at the end of substitution string:
RewriteRule (.*) http://shop.domain.co.uk/${mapfilet:$1}? [NC,R=301,L]
Re: Mapfile without QueryString
Brilliant many thanks for that.
This works great for this
However if I have a map file with just:
Then when I try the url
This works great for this
- Code: Select all
abc/def/ghi/?WT.ac=956 shop.asp/menswear-clothing
However if I have a map file with just:
- Code: Select all
?abc=search shop.asp
Then when I try the url
- Code: Select all
www.domain.com?abc=search
Re: Mapfile without QueryString
Hello,
Please try to use the following rules:
RewriteMap mapfilet txt:d:\ISAPI_Rewrite3\tele.txt [NC]
RewriteCond %{HTTP:HOST} .*domain.co.uk
RewriteCond ${mapfilet:($1\?%{QUERY_STRING})|NOT_FOUND} !NOT_FOUND
RewriteRule (.*) http://shop.domain.co.uk/${mapfilet:($1\?%{QUERY_STRING})}? [NC,R=301,L]
Please try to use the following rules:
RewriteMap mapfilet txt:d:\ISAPI_Rewrite3\tele.txt [NC]
RewriteCond %{HTTP:HOST} .*domain.co.uk
RewriteCond ${mapfilet:($1\?%{QUERY_STRING})|NOT_FOUND} !NOT_FOUND
RewriteRule (.*) http://shop.domain.co.uk/${mapfilet:($1\?%{QUERY_STRING})}? [NC,R=301,L]
Re: Mapfile without QueryString
Many thanks
That works as long as i use both:
That works as long as i use both:
- Code: Select all
RewriteMap mapfilet txt:d:\ISAPI_Rewrite3\tele.txt [NC]
RewriteCond %{HTTP:HOST} .*domain.co.uk
RewriteCond ${mapfilet:$1|NOT_FOUND} !NOT_FOUND
RewriteRule (.*) http://shop.domain.co.uk/${mapfilet:$1}? [NC,R=301,L]
RewriteMap mapfilet txt:d:\ISAPI_Rewrite3\tele.txt [NC]
RewriteCond %{HTTP:HOST} .*domain.co.uk
RewriteCond ${mapfilet:($1\?%{QUERY_STRING})|NOT_FOUND} !NOT_FOUND
RewriteRule (.*) http://shop.domain.co.uk/${mapfilet:($1\?%{QUERY_STRING})}? [NC,R=301,L]
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests