| Author |
|
sahil80 Newbie

Joined: 17 June 2008
Online Status: Offline Posts: 7
|
| Posted: 18 June 2008 at 7:39am | IP Logged
|
|
|
I am struggling to achieve 301 redirection.
This is my whole httpd.ini file for ISAPI _REWRITE 2
Code:
[ISAPI_Rewrite] RewriteCond Host: aptlogix\.com RewriteRule /index.php http\://www.aptlogix.com [I,RP]
|
|
|
when i access http://aptlogix.com it gives me a strange message the resouce has been moved rather than giving me a 301 redirection. Can some one please provide me a sample Rule to do the 301 redirection for above scenario
Thanks
Danish
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 7460
|
| Posted: 18 June 2008 at 7:54am | IP Logged
|
|
|
The rule is correct. Most probably your browser does not want to perform an automaic redirect and shows a response body (which contains the mentioned message). Or may be there is a proxy between a browser and a server that incorrectly handles server response and breaks response headers.
It would be nice if you would show me a response headers. They could be captured with the help of a browser plugin like IEHeaders or HttpWatch for IE or HTTP Headers Spy for Firefox or with the help of the Fiddler proxy.
|
| Back to Top |
|
| |
sahil80 Newbie

Joined: 17 June 2008
Online Status: Offline Posts: 7
|
| Posted: 18 June 2008 at 7:59am | IP Logged
|
|
|
Code:
SEO Consultants Directory Check Server Headers - Single URI Results Current Date and Time: 2008-06-18T05:34:49-0700 User IP Address: 116.71.170.30
#1 Server Response: http://aptlogix.com HTTP Status Code: HTTP/1.0 200 OK
|
|
|
I am not using any proxy. It works perfect on my local win2k3 box. It seems there is some additional configuration i need for ISAPI REWRITE to work? i am not very sure.
I generated above response with
http://www.seoconsultants.com/tools/headers.asp#results
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 7460
|
| Posted: 18 June 2008 at 8:14am | IP Logged
|
|
|
Hm... Just have checked it myself. It looks like your web server completely eats response headers of a redirect. Most probably there is some other ISAPI filter that misbehaves on ISAPI_Rewrite redirect responses.
You could try to add
RFStyle New
directive to the global httpd.ini as a workaround.
BTW, what ISAPI_Rewrite build are you using?
|
| Back to Top |
|
| |
sahil80 Newbie

Joined: 17 June 2008
Online Status: Offline Posts: 7
|
| Posted: 18 June 2008 at 8:17am | IP Logged
|
|
|
I am using 2.10.0.53
is there any workaround if i do not have access to global httpd.ini?
|
| Back to Top |
|
| |
sahil80 Newbie

Joined: 17 June 2008
Online Status: Offline Posts: 7
|
| Posted: 18 June 2008 at 8:18am | IP Logged
|
|
|
ok i added
RFStyle New
to httpd.ini that is inside my hosting root directory and now it gives a 404 error.
you can check it at http://aptlogix.com
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 7460
|
| Posted: 18 June 2008 at 8:34am | IP Logged
|
|
|
Run
cscript proxycfg.vbs -r
command from the ISAPI_Rewrite installation folder.
|
| Back to Top |
|
| |
sahil80 Newbie

Joined: 17 June 2008
Online Status: Offline Posts: 7
|
| Posted: 18 June 2008 at 8:39am | IP Logged
|
|
|
Thanks for the message.
Since its a shared hosting i do not have access to the box.
Anyway, For reference for anybody else who needs a work around of this on shared hostings. I have tricked it with a piece of code of php
I have following in my httpd.ini file
Code:
RewriteCond Host: aptlogix\.com RewriteRule /(.*) /_redirect_do.php?r=$1 [I,L]
|
|
|
I created a file _redirect_do.php on the root of the ftp and have the following code in it
Code:
<? $r = $_GET['r'];
header( "HTTP/1.1 301 Moved Permanently" ); header( "Location: http://www.aptlogix.com/$r" ); ?>
|
|
|
and it does the job.
I checked the headers and they seem to be working normal.
Thanks for the help Lexey.
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 7460
|
| Posted: 18 June 2008 at 8:46am | IP Logged
|
|
|
Right, that is a possible workaround too.
|
| Back to Top |
|
| |