This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions
 Helicon Tech : Common Questions
Subject Topic: Redirect entire site to a new domain Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
dtnsemprog
Newbie
Newbie


Joined: 10 March 2010
Location: United States
Online Status: Offline
Posts: 19
Posted: 22 February 2011 at 1:33pm | IP Logged Quote dtnsemprog

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 View dtnsemprog's Profile Search for other posts by dtnsemprog
 
Guests
Guest
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -149
Posted: 23 February 2011 at 5:43am | IP Logged Quote Guests

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

Regards
Andrew
Back to Top View Guests's Profile Search for other posts by Guests
 
dtnsemprog
Newbie
Newbie


Joined: 10 March 2010
Location: United States
Online Status: Offline
Posts: 19
Posted: 23 February 2011 at 12:45pm | IP Logged Quote dtnsemprog

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 View dtnsemprog's Profile Search for other posts by dtnsemprog
 
Guests
Guest
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -149
Posted: 24 February 2011 at 5:42am | IP Logged Quote Guests

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


Joined: 10 March 2010
Location: United States
Online Status: Offline
Posts: 19
Posted: 24 February 2011 at 12:17pm | IP Logged Quote dtnsemprog

Thanks Andrew!  That worked perfectly.
Back to Top View dtnsemprog's Profile Search for other posts by dtnsemprog
 
emily
Newbie
Newbie


Joined: 06 April 2011
Online Status: Offline
Posts: 1
Posted: 06 April 2011 at 12:27am | IP Logged Quote emily

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 View emily's Profile Search for other posts by emily Visit emily's Homepage
 
outshinesol
Newbie
Newbie


Joined: 03 August 2011
Location: India
Online Status: Offline
Posts: 1
Posted: 03 August 2011 at 7:36am | IP Logged Quote outshinesol

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 View outshinesol's Profile Search for other posts by outshinesol Visit outshinesol's Homepage
 

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