Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x support forum
 Helicon Tech : ISAPI_Rewrite 2.x support forum
Subject Topic: 301 Redirection HELP Please Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
sahil80
Newbie
Newbie


Joined: 17 June 2008
Online Status: Offline
Posts: 7
Posted: 18 June 2008 at 7:39am | IP Logged Quote sahil80

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 View sahil80's Profile Search for other posts by sahil80
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7460
Posted: 18 June 2008 at 7:54am | IP Logged Quote Lexey

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 View Lexey's Profile Search for other posts by Lexey
 
sahil80
Newbie
Newbie


Joined: 17 June 2008
Online Status: Offline
Posts: 7
Posted: 18 June 2008 at 7:59am | IP Logged Quote sahil80

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 View sahil80's Profile Search for other posts by sahil80
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7460
Posted: 18 June 2008 at 8:14am | IP Logged Quote Lexey

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 View Lexey's Profile Search for other posts by Lexey
 
sahil80
Newbie
Newbie


Joined: 17 June 2008
Online Status: Offline
Posts: 7
Posted: 18 June 2008 at 8:17am | IP Logged Quote sahil80

I am using 2.10.0.53

is there any workaround if i do not have access to global httpd.ini?

Back to Top View sahil80's Profile Search for other posts by sahil80
 
sahil80
Newbie
Newbie


Joined: 17 June 2008
Online Status: Offline
Posts: 7
Posted: 18 June 2008 at 8:18am | IP Logged Quote sahil80

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 View sahil80's Profile Search for other posts by sahil80
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7460
Posted: 18 June 2008 at 8:34am | IP Logged Quote Lexey

Run
cscript proxycfg.vbs -r
command from the ISAPI_Rewrite installation folder.
Back to Top View Lexey's Profile Search for other posts by Lexey
 
sahil80
Newbie
Newbie


Joined: 17 June 2008
Online Status: Offline
Posts: 7
Posted: 18 June 2008 at 8:39am | IP Logged Quote sahil80

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 View sahil80's Profile Search for other posts by sahil80
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7460
Posted: 18 June 2008 at 8:46am | IP Logged Quote Lexey

Right, that is a possible workaround too.
Back to Top View Lexey's Profile Search for other posts by Lexey
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum