Help redirecting a url
13 posts
• Page 1 of 1
Help redirecting a url
Hello,
I am having difficulty redirect a URL. I think I have the wrong rewrite code.
Please see my example below and I would greatly appreciate any feed back
I would like to redirect:
OLD URL: www.mywebsite.com/page1.html
NEW URL: www.mywebsite.com/newpage.htm
What would be the correct way to do a 301 redirect?
TIA!
PS I am running Rewrite 3.0
I am having difficulty redirect a URL. I think I have the wrong rewrite code.
Please see my example below and I would greatly appreciate any feed back
I would like to redirect:
OLD URL: www.mywebsite.com/page1.html
NEW URL: www.mywebsite.com/newpage.htm
What would be the correct way to do a 301 redirect?
TIA!
PS I am running Rewrite 3.0
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Help redirecting a url
Hello,
Try using:
Regards
Andrew
Try using:
- Code: Select all
RewriteEngine on
RewriteBase /
Rewriterule ^page1\.html$ /newpage.htm [NC,R=301,L]
Regards
Andrew
Re: Help redirecting a url
Hi Andrew,
Thanks a ton! The expression worked. I am however having trouble redirecting my category lists.
Here is an example:
OLD URL: https://www.mysite.com/products.int?Category=abc123
NEW URL: https://www.mysite.com/products.int?Category=def456
Below is the expression I am using, but if I request the "old" url I receive a 404:
RewriteCond %{QUERY_STRING} ^abc123$ [NC]
RewriteRule ^/products.int$ /products.int?Category=def456? [NC,R=301,L]
Can you please let me know what I am doing wrong?
TIA!
Thanks a ton! The expression worked. I am however having trouble redirecting my category lists.
Here is an example:
OLD URL: https://www.mysite.com/products.int?Category=abc123
NEW URL: https://www.mysite.com/products.int?Category=def456
Below is the expression I am using, but if I request the "old" url I receive a 404:
RewriteCond %{QUERY_STRING} ^abc123$ [NC]
RewriteRule ^/products.int$ /products.int?Category=def456? [NC,R=301,L]
Can you please let me know what I am doing wrong?
TIA!
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Help redirecting a url
Try using more like the following:
Regards
Andrew
- Code: Select all
RewriteCond %{QUERY_STRING} ^Category=abc123$ [NC]
RewriteRule ^products\.int$ /products.int?Category=def456? [NC,R=301,L]
Regards
Andrew
Re: Help redirecting a url
Hi Andrew,
I have the redirect you suggested in place, it is working, but on one particular url it will not work and I receive a 404
Here is the expression I am using:
Example1
RewriteCond %{QUERY_STRING} ^Category=LCD+DLP+TV+LAMPS$ [NC]
RewriteRule ^products\.int$ /products.int?Category=LCD+DLP+PROJECTOR+TV+LAMPS? [NC,R=301,L]
This will result in a 404
Just for testing purposes I tried the expression below and it works:
Example2
RewriteCond %{QUERY_STRING} ^Category=TESTME$ [NC]
RewriteRule ^products\.int$ /products.int?Category=LCD+DLP+PROJECTOR+TV+LAMPS? [NC,R=301,L]
Any idea why the query string TESTME in example2 works, but not the query string LCD+DLP+TVLAMPS in Example1 ?
TIA
I have the redirect you suggested in place, it is working, but on one particular url it will not work and I receive a 404
Here is the expression I am using:
Example1
RewriteCond %{QUERY_STRING} ^Category=LCD+DLP+TV+LAMPS$ [NC]
RewriteRule ^products\.int$ /products.int?Category=LCD+DLP+PROJECTOR+TV+LAMPS? [NC,R=301,L]
This will result in a 404
Just for testing purposes I tried the expression below and it works:
Example2
RewriteCond %{QUERY_STRING} ^Category=TESTME$ [NC]
RewriteRule ^products\.int$ /products.int?Category=LCD+DLP+PROJECTOR+TV+LAMPS? [NC,R=301,L]
Any idea why the query string TESTME in example2 works, but not the query string LCD+DLP+TVLAMPS in Example1 ?
TIA
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Help redirecting a url
I just notices that it's the same question and the same author as in topic. Please, do not duplicate the issue all over the place.
Regards
Andrew
Regards
Andrew
Re: Help redirecting a url
Hi Andrew,
My other topic you referred to is in relation to a + in url.
This particular topic has no relation to that other topic. I am looking for help on a rewrite for this topic, not dealing with + in url
TIA
My other topic you referred to is in relation to a + in url.
This particular topic has no relation to that other topic. I am looking for help on a rewrite for this topic, not dealing with + in url
TIA
Re: Help redirecting a url
I just disabled URL scan, restarted IIS and I still can not process a url with double escaping.
Any other suggestions?
Thanks,
Aaron
Any other suggestions?
Thanks,
Aaron
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Help redirecting a url
Well, as lona as "query string TESTME in example2 works" and in Example 1 doesn't, it means the '+' sign in querystring parameter is not working. The rule is correct and ISAPI_Rewrite is working.
Regards
Andrew
Regards
Andrew
Re: Help redirecting a url
It seems any "test" URL I try as long as it does not double escape + works.
I completely disables URL scan, restarted IIS and still can not get these to work..
I completely disables URL scan, restarted IIS and still can not get these to work..
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Help redirecting a url
And if you disable ISAPI_Rewrite does it still gives 404 for '+' sign? If so, than it's IIS settings smowhere... or the URL_Scan is not disabled.
Regards
Andrew
Regards
Andrew
13 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests