This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions (Forum Locked Forum Locked)
 Helicon Tech : Common Questions
Subject Topic: Redirect entire site to a new domain
Author
Message |
dtnsemprog
Newbie


Joined: 10 March 2010
Location: United States
Posts: 19
Posted: 22 February 2011 at 1:33pm

What I am trying to do is redirect an entire site to another domain using the isapi file.  However, there are some directories that I do not want to redirect. The site has hundreds of directories and about 90% of them will redirect to the new domain on another server. 

Does anyone know a way that I could write a rule that would redirect the entire site except for a few specified directories?
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 23 February 2011 at 5:43am

Hello,
PLease, see FAQ under "Excluding specific folders from being rewritten"

Regards
Andrew
Back to Top
 
dtnsemprog
Newbie


Joined: 10 March 2010
Location: United States
Posts: 19
Posted: 23 February 2011 at 12:45pm

Thanks for the reply Andrew.  This is the rule I came up with based on the documentation in the FAQ:


RewriteCond %{SERVER_NAME} ^(?:www\.)?oldsite\.com$
RewriteRule ^(?!(?:folder1|folder2|folder3)/.*).+$ http://www.newdomain.com/ [NC,R=301,L]

And for the most part it seems to work.  Folders included in the exception do not get redirected and the other folders do.  However, if I just go to "http://www.oldsite.com/" it does not get redirected either. How can I fix this?

Thank you,
Jon
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 24 February 2011 at 5:42am

For that, I think you need to replace '+' with '*' here:

RewriteRule ^(?!(?:folder1|folder2|folder3)/.*).*$ http://www.newdomain.com/ [NC,R=301,L]

Regards
Andrew
Back to Top
 
dtnsemprog
Newbie


Joined: 10 March 2010
Location: United States
Posts: 19
Posted: 24 February 2011 at 12:17pm

Thanks Andrew!  That worked perfectly.
Back to Top
 
emily
Newbie


Joined: 06 April 2011
Posts: 1
Posted: 06 April 2011 at 12:27am

I think this statement will work:
RewriteCond %{SERVER_NAME} ^(?:www\.)?oldsite\.com$
RewriteRule ^(?!(?:folder1|folder2|folder3)/.*).+$ http://www.newdomain.com/ [NC,R=301,L]

__________________
Essay services | Custom Essay Papers
Back to Top Visit emily's Homepage
 
outshinesol
Newbie


Joined: 03 August 2011
Location: India
Posts: 1
Posted: 03 August 2011 at 7:36am

RewriteCond %{HTTP_HOST} ^site\com [NC]
RewriteRule (.*) http://www.site.com/$1 [L,R=301]


I thin this wil help you


__________________
Vikas Arora
Dedicated Servers India
Back to Top Visit outshinesol's Homepage
 

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