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


Joined: 05 November 2009
Location: India
Online Status: Offline
Posts: 7
Posted: 28 January 2010 at 8:18am | IP Logged Quote TFR1

Hi

I am getting a redirection loop error while trying to redirect to a different location and then internally rewrite. Please note that I am using httpd.ini and not htaccess.

Here is an example of current site:
http://www.example.com/directory/filename.aspx

I want to remove the 'directory' folder so that it works like this:
http://www.example.com/filename.aspx

For that, I have used below rules -

RewriteCond %{HTTP_HOST} www.example.com/directory$
RewriteRule ^/directory/(.*)$ http://www.example.com/$1 [I,RP,L]

and then an internal redirect to it's corresponding pages -

RewriteRule /filename(.*) /directory/filename$1 [I,L]

If I remove any of the above rules, it works fine but if I run both I get a redirect loop error.

What is it that I am missing? Can you please suggest?

Thanks in advance!
Hetal

Back to Top View TFR1's Profile Search for other posts by TFR1
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10487
Posted: 28 January 2010 at 9:07am | IP Logged Quote Anton

If you are using ISAPI_Rewrite v2, the config should be as follows:

RewriteCond Host: www.example.com
RewriteRule /directory/(.*) http\://www.example.com/$1 [I,RP]

RewriteRule /filename(.*) /directory/filename$1 [I,L]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
TFR1
Newbie
Newbie


Joined: 05 November 2009
Location: India
Online Status: Offline
Posts: 7
Posted: 29 January 2010 at 6:06am | IP Logged Quote TFR1

Thanks, but I still get the same error. Also it would be great if you can provide me as how to enable logging and debugging in httpd.ini. I tried using below lines, but presumably the syntax would be different.

RewriteLogLevel 9
LogLevel debug 

I tried out many other ways for redirection and rewriting, but ends up in the same redirection loop error. Can you please suggest where am I going wrong?

Thanks in advance!

Back to Top View TFR1's Profile Search for other posts by TFR1
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10487
Posted: 29 January 2010 at 8:22am | IP Logged Quote Anton

Please try to replace the RP flag with R.

Also please tell whether you have any other rules in the config except those above?

Unfortunately, there's no logging in v2. The directives you tried to use are for v3.

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 

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