Rewrite to new url issue
3 posts
• Page 1 of 1
- simonchalk
- Posts: 4
- Joined: 30 May 2012, 06:07
Rewrite to new url issue
Hi
I am trying to rewrite one url to another as follows: -
RewriteRule ^/subfolder/brandname.asp\?brandname=mybrand$ http://mywebsite.com/folder/newbrand.asp[NC,R=301,L]
When I do this I get redirected to the correct page, but it has the query part appended onto the new url as follows
http://mywebsite.com/folder/newbrand.as ... me=mybrand
But I don want this to happen, so please advise how I stop this?
All I want is http://mywebsite.com/folder/newbrand.asp
I am trying to rewrite one url to another as follows: -
RewriteRule ^/subfolder/brandname.asp\?brandname=mybrand$ http://mywebsite.com/folder/newbrand.asp[NC,R=301,L]
When I do this I get redirected to the correct page, but it has the query part appended onto the new url as follows
http://mywebsite.com/folder/newbrand.as ... me=mybrand
But I don want this to happen, so please advise how I stop this?
All I want is http://mywebsite.com/folder/newbrand.asp
- simonchalk
- Posts: 4
- Joined: 30 May 2012, 06:07
Re: Rewrite to new url issue
Actually I think this is working, but the effect I see is happening in Internet Explorer 8, 9. If I use a different browser then the redirected url is correct. Very strange, any thoughts?
Re: Rewrite to new url issue
The config for ISAPI_Rewrite 3 should be like this:
RewriteCond %{QUERY_STRING} ^brandname=mybrand$ [NC]
RewriteRule ^/subfolder/brandname\.asp$ http://mywebsite.com/folder/newbrand.asp? [NC,R=301,L]
Notice, the question mark is used at the end of the substitution pattern to prevent initial query string from being appended.
RewriteCond %{QUERY_STRING} ^brandname=mybrand$ [NC]
RewriteRule ^/subfolder/brandname\.asp$ http://mywebsite.com/folder/newbrand.asp? [NC,R=301,L]
Notice, the question mark is used at the end of the substitution pattern to prevent initial query string from being appended.
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests