Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend
Featured Web Site Template

Hundreds More at Free Site Templates.com!

Web Site Partners
Sponsored Links
Jet City Software
 
Whos Here ?
Reflects user activity within the last 5 minutes
Moderator(s): Prowler, jcokos
Member Message

Hampstead
Joined: Feb 20, 2001
# Posts: 2012

View the profile for Hampstead Send Hampstead a private message

Posted: 2008-Jun-12 11:49
Edit Message Delete Message Reply to this message

I need to forward users from a defunct site to a new site. They are not copies of each other. One is taking over and the other will be shut down.

It's easy to 301 the entire site using htaccess, but what I also want to do is to have certain page requests within the old site forward to a relevant page on the new site.

The standard 301 redirect code for the htaccess file will override this by sending anything at the old domain to the new domain.

I also wanted to have the old site moved to a different directory on the old URL so that it could be accessed as domain.com/legacy2008 for instance.

Is this possible using mod rewrite?

If so, help with syntax would be much appreciated.



g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10418

View the profile for g1smd Send g1smd a private message

Posted: 2008-Jun-12 19:12
Edit Message Delete Message Reply to this message

Yes. You will need several rules and they must all use the same Apache module in order to guarantee the order they are processed in.

Put the more detailed rules first and they will operate first for those specific URLs.

Put the general site-wide "catch-all" rules last. They will pick up all the stuff that didn't get done by the earlier rules.



Hampstead
Joined: Feb 20, 2001
# Posts: 2012

View the profile for Hampstead Send Hampstead a private message

Posted: 2008-Jun-12 20:44
Edit Message Delete Message Reply to this message

Ah - that's the trick.

What about having the site in legacy directory? Won't that get forwarded too?



g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10418

View the profile for g1smd Send g1smd a private message

Posted: 2008-Jun-12 21:15
Edit Message Delete Message Reply to this message

Move the old site to the folder, and set your redirects so that they do not occur for URLs in that folder.

No idea how people will ever find the old site at new URLs if the old site itself has new URLs?? I guess you will need to keep the root index page of the old site live and offer links to the old site (at new URLs) and new site (on new domain) from there.

Beware the duplicate content filter if the content is similar.



Hampstead
Joined: Feb 20, 2001
# Posts: 2012

View the profile for Hampstead Send Hampstead a private message

Posted: 2008-Jun-12 22:02
Edit Message Delete Message Reply to this message

They're different sites.

One company has bought another and want to use the redirects so as to keep any of the existing traffic whilst shutting down the site. They want the legacy site so that they can access it themselves if they need to remind themselves of the content.

They don't want people to find the old site in it's new position. A robots text and tag will be used to stop accidental indexing.



g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10418

View the profile for g1smd Send g1smd a private message

Posted: 2008-Jun-12 22:15
Edit Message Delete Message Reply to this message

If you really don't want it to be found, then the robots.txt method is too weedy.

Put the old site behind a password log-in using .htaccess/.htpasswd instead.



Hampstead
Joined: Feb 20, 2001
# Posts: 2012

View the profile for Hampstead Send Hampstead a private message

Posted: 2008-Jun-12 22:25
Edit Message Delete Message Reply to this message

Good idea.



Hampstead
Joined: Feb 20, 2001
# Posts: 2012

View the profile for Hampstead Send Hampstead a private message

Posted: 2008-Jun-12 22:27
Edit Message Delete Message Reply to this message

I'm still a bit confused on the syntax though.

I'm not sure how to stop the legacy site redirecting because there will be a catch all.



g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10418

View the profile for g1smd Send g1smd a private message

Posted: 2008-Jun-12 23:20
Edit Message Delete Message Reply to this message

Use ! as a prefix for "NOT" in the RewriteCond.




Hampstead
Joined: Feb 20, 2001
# Posts: 2012

View the profile for Hampstead Send Hampstead a private message

Posted: 2008-Jun-12 23:24
Edit Message Delete Message Reply to this message

Thanks - I'll test it out.


You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
  1. You have not yet logged in, or registered properly as a member
  2. You are a member, but no longer have posting rights.
  3. This is a private forum, for which you do not have permissions.

If you are a recent member, it's possible that you simply have not yet confirmed your account. Please check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions contained within.

If you cannot find this message, click here to Re-Send it.

If you are still experiencing problem, please read the Login Assistance Article for some advice on what may be causing your login not to work properly.

Switch to Advanced Editor and ... Create a New Topic or Reply to this Thread

New posts Forum is locked
© 1995  ·  iWeb, Inc  ·  DBA JimWorld Productions