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: Redirect to folder Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Steve2507
Newbie
Newbie


Joined: 15 May 2007
Online Status: Offline
Posts: 12
Posted: 02 April 2008 at 4:26am | IP Logged Quote Steve2507

I thought this would be straightforward, but for some reason I can't get my head around it, (having a bad day).

I need to ensure that anything going to the root folder (www.mydomain.com) is redirected to www.mydomain.com/folder/ but I just can;t seem to get my head around doing it.

I though this would work, but it doesn't:

RewriteRule /.* http\://www.mydomain.co.uk/articles/ [I,RP]

Any ideas anyone?

Thanks

Steve

Back to Top View Steve2507's Profile Search for other posts by Steve2507
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7372
Posted: 02 April 2008 at 10:22am | IP Logged Quote Lexey

RewriteRule /[^/?]*(?:\?.*)? http\://www.mydomain.co.uk/articles$0 [I,RP]
Back to Top View Lexey's Profile Search for other posts by Lexey
 
Steve2507
Newbie
Newbie


Joined: 15 May 2007
Online Status: Offline
Posts: 12
Posted: 03 April 2008 at 4:00am | IP Logged Quote Steve2507

Fantastic, works a treat.

I've tried to breakdown the code you gave me and still can't work it out.

Thanks for the help.

Steve

Back to Top View Steve2507's Profile Search for other posts by Steve2507
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7372
Posted: 03 April 2008 at 9:20am | IP Logged Quote Lexey

It is quite simple:

If URI is "slash" (/) followed by "anything except slash and question mark" ([^/?]*) followed by "optional question mark followed by anything" ((?:\?.*)?)
redirect it to http://.../articles followed by original URI ($0).

Edited by Lexey - 03 April 2008 at 9:20am
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