This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Basic rule - exclude specific directories
Author
Message |
simonrl
Newbie


Joined: 29 May 2005
Location: United Kingdom
Posts: 12
Posted: 02 March 2011 at 5:48am

I'm using this very basic rule:

[ISAPI_Rewrite]

RewriteRule /([^./]+)/? /default.aspx\?ref=$1 [I,L]

It rewrites http://www.somedomain.co.uk/some-url/

To:

http://www.somedomain.co.uk/default.aspx?ref=123

Is it possible to exclude in a rule certain values that aren't passed in ?ref= but are physical folders, e.g.

http://www.somedomain.co.uk/admin/
http://www.somedomain.co.uk/uploads/

Those aren't to be re-writen, whereas anything not specified does get re-written.

Thanks!


Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 02 March 2011 at 7:47am

Yes, sure it's possible:

[ISAPI_Rewrite]

RewriteRule /(?!(?:admin|uploads).*)([^./]+)/? /default.aspx\?ref=$1 [I,L]

__________________
Regards,
Anton
Back to Top
 
simonrl
Newbie


Joined: 29 May 2005
Location: United Kingdom
Posts: 12
Posted: 02 March 2011 at 7:58am

Thank you. Perfect!
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
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