"Moving site location" example not working (IIS 6)
8 posts
• Page 1 of 1
"Moving site location" example not working (IIS 6)
I'm testing with the "Moving site location" from the docs, which give an example of:
RewriteEngine on
#Permanent redirect to update old links
RewriteRule (.+) http://newserver.com$1 [R=301,L]
This isn't working for some reason but I'm not sure why. A test using forcing www to the URL does work, so I know ISAPI Rewrite 3 is working on the site in general. Does anything need to be added to the above to make it worki? (I replaced newserver.com with the real URL but that's the only change I made to the above)
Thanks
RewriteEngine on
#Permanent redirect to update old links
RewriteRule (.+) http://newserver.com$1 [R=301,L]
This isn't working for some reason but I'm not sure why. A test using forcing www to the URL does work, so I know ISAPI Rewrite 3 is working on the site in general. Does anything need to be added to the above to make it worki? (I replaced newserver.com with the real URL but that's the only change I made to the above)
Thanks
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: "Moving site location" example not working (IIS 6)
Others work? And this doesn't? In the same file? Weird... The rule is okay.
We'll need to look in the logs. Please, see logging details in FAQ - http://www.helicontech.com/forum/10648-FAQ.html
Regards
Andrew
We'll need to look in the logs. Please, see logging details in FAQ - http://www.helicontech.com/forum/10648-FAQ.html
Regards
Andrew
Re: "Moving site location" example not working (IIS 6)
Thanks Andrew,
Below is the sanitized verson of the log.
The .htaccess file has exactly this code (this is just for testing):
RewriteEngine on
#Permanent redirect to update old links
RewriteRule (.+) http://google.com$1 [R=301,L]
The logs seems to indicate ISAPI rewrite is trying to do something, but when I hit the web page it doesn't take me to Google's site, it shows my test home page.
(2) init rewrite engine with requested uri /
(1) Htaccess process request C:\components\Helicon\ISAPI_Rewrite3\httpd.conf
(1) Htaccess process request d:\domains\redirect.xxxxxxxx.com\wwwroot\.htaccess
(3) applying pattern '(.+)' to uri ''
(2) init rewrite engine with requested uri /favicon.ico
(1) Htaccess process request C:\components\Helicon\ISAPI_Rewrite3\httpd.conf
(1) Htaccess process request d:\domains\redirect.xxxxxxxx.com\wwwroot\.htaccess
(3) applying pattern '(.+)' to uri 'favicon.ico'
(1) escaping http://google.comfavicon.ico
(2) explicitly forcing redirect with http://google.comfavicon.ico
(2) internal redirect with /favicon.ico [INTERNAL REDIRECT]
(2) init rewrite engine with requested uri /
(1) Htaccess process request C:\components\Helicon\ISAPI_Rewrite3\httpd.conf
(1) Htaccess process request d:\domains\redirect.xxxxxxxx.com\wwwroot\.htaccess
(3) applying pattern '(.+)' to uri ''
(2) init rewrite engine with requested uri /
(1) Htaccess process request C:\components\Helicon\ISAPI_Rewrite3\httpd.conf
(1) Htaccess process request d:\domains\redirect.xxxxxxxx.com\wwwroot\.htaccess
(3) applying pattern '(.+)' to uri ''
Thanks
Below is the sanitized verson of the log.
The .htaccess file has exactly this code (this is just for testing):
RewriteEngine on
#Permanent redirect to update old links
RewriteRule (.+) http://google.com$1 [R=301,L]
The logs seems to indicate ISAPI rewrite is trying to do something, but when I hit the web page it doesn't take me to Google's site, it shows my test home page.
(2) init rewrite engine with requested uri /
(1) Htaccess process request C:\components\Helicon\ISAPI_Rewrite3\httpd.conf
(1) Htaccess process request d:\domains\redirect.xxxxxxxx.com\wwwroot\.htaccess
(3) applying pattern '(.+)' to uri ''
(2) init rewrite engine with requested uri /favicon.ico
(1) Htaccess process request C:\components\Helicon\ISAPI_Rewrite3\httpd.conf
(1) Htaccess process request d:\domains\redirect.xxxxxxxx.com\wwwroot\.htaccess
(3) applying pattern '(.+)' to uri 'favicon.ico'
(1) escaping http://google.comfavicon.ico
(2) explicitly forcing redirect with http://google.comfavicon.ico
(2) internal redirect with /favicon.ico [INTERNAL REDIRECT]
(2) init rewrite engine with requested uri /
(1) Htaccess process request C:\components\Helicon\ISAPI_Rewrite3\httpd.conf
(1) Htaccess process request d:\domains\redirect.xxxxxxxx.com\wwwroot\.htaccess
(3) applying pattern '(.+)' to uri ''
(2) init rewrite engine with requested uri /
(1) Htaccess process request C:\components\Helicon\ISAPI_Rewrite3\httpd.conf
(1) Htaccess process request d:\domains\redirect.xxxxxxxx.com\wwwroot\.htaccess
(3) applying pattern '(.+)' to uri ''
Thanks
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: "Moving site location" example not working (IIS 6)
The problem I see here is that you request the root of the web-site. And your rulerequesres at least one character after the root.
So all you need to do is to replace (.+) with (.*)
Regards
Andrew
So all you need to do is to replace (.+) with (.*)
Regards
Andrew
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: "Moving site location" example not working (IIS 6)
Thanks Andrew
It works with the changes you recommended.
You might want to update the example in your documentation as I was using exactly that code.
Thanks again
It works with the changes you recommended.
You might want to update the example in your documentation as I was using exactly that code.
Thanks again
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: "Moving site location" example not working (IIS 6)
Not really. We used it in httpd.conf in our documentation. Here it's .htaccess. The difference is that in .htaccess "RewriteBase /" directive is on by default.
Regards
Andrew
Regards
Andrew
Re: "Moving site location" example not working (IIS 6)
ok, it's just that is was on this page which is labeled as "ISAPI_Rewrite 3 Documentation"
http://www.helicontech.com/isapi_rewrit ... amples.htm
http://www.helicontech.com/isapi_rewrit ... amples.htm
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 16 guests