homepage Welcome to WebmasterWorld Guest from 50.17.7.84
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Newbie needs redirect help
301 redirect from old site to new site
RonSolo




msg:4481721
 8:40 pm on Aug 3, 2012 (gmt 0)

I'm very new to setting up a 301 redirect and I'm hoping that someone can help me.

I have a new website with a new domain. I need to set up 301 redirects for pages on my old site (and different domain) to pages on my new site.


1. Do I need to add any redirect rules in the .htaccess file on the old site/domain? If so, what do I put there? And how long do I leave it before I can close down and remove the site from the server?


2. What is the complete redirect code that I would need to place in the .htaccess file on the new site?


3. Should I also include a redirect for possible 404 pages on the old site and redirect them to the new site's home page? If so, where do I enter it and what is the code for that?


Thank you,
Ron

 

lucy24




msg:4481768
 1:59 am on Aug 4, 2012 (gmt 0)

1. Do I need to add any redirect rules in the .htaccess file on the old site/domain?

ALL redirects will go on the old site. Once the request arrives at the new site, there should be no further redirects. The new site's htaccess will only be for people who requested the new domain in the first place.

2. What is the complete redirect code that I would need to place in the .htaccess file on the new site?

Oh, come on. You've been here since 2007. You know better.

:: shuffling papers ::


Why We Make You Do It Yourself

There are plenty of forums where you can post a "how-to" question and get a fairly immediate answer. The answer may even be correct. But WebmasterWorld is about teaching you how to do it yourself. That way you can roll your own htaccess-- not just for today's problem but for tomorrow's almost identical one.

Here is the analogy:

Your child's room needs cleaning. You know that you can clean it yourself much faster and better than if you have to stand over your child and force him to do it right. But if you do the "make him get it right" part often enough, you will have raised a child who knows how to clean his room-- and who will some day stand glowering over his own children in the same circumstances.

Some day, someone else will post a question in the WebmasterWorld forums and you'll say "Hey, I know the answer to that one!"

Besides, when someone with a low post count asks a question, that person may have posted the identical question in six different forums. They grab the first answer they get, and never even come back to the others. You can understand that this is infuriating for the person who took the time to compose an answer.

RonSolo




msg:4481858
 4:05 pm on Aug 4, 2012 (gmt 0)

Thanks Lucy.
I know, I know. Shame on me for asking. :)

Shocking as it is, it's my first time dealing with this situation of a new domain replacing an old one and setting up the 301 redirects. I'll find the correct rewrite code, but one last question ... how long do I leave the old domain running with the 301 redirects before I shut it down completely?

Thank you,
Ron

g1smd




msg:4481880
 7:31 pm on Aug 4, 2012 (gmt 0)

You should leave the old domain online for as long as possible, hopefully for many years.

You do NOT need separate hosting for this redirect. Point all domains at one server and redirect non-canonical requests from there (back to new URL on the same server).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved