Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a situation where I'm standing up a new website on a different web host. I've been denied access to the old site by the hosting company and the old site will most likely be turned off very soon.

If my new site contains pages that are named slightly different how do I go about setting up 301 redirects on my new site?

For example:

www.oldsite.com\aboutus\
www.newsite.com\aboutus.html

www.newsite.com\productx.html
www.oldsite.com\productx\

Edit: Clarification:

The old domain name is different from the new domain name.

On my newsite do I just duplicate every page that existed on the old site and place redirect code inside those pages? What does the redirect code look like?

share|improve this question
    
It's kinda hard to do 301 redirects without access to the old website. –  John Conde Sep 14 '11 at 13:23
2  
Is the new site on the same domain name? (I know you've used a different one in the question, but I was asking just in case you did that to illustrate what you mean.) –  paulmorriss Sep 14 '11 at 13:29
    
Different domain name. –  Cape Cod Gunny Sep 14 '11 at 13:38
1  
As John says, you're stuck. –  paulmorriss Sep 14 '11 at 14:32
add comment

2 Answers

It's a useless proposition to put any of this on the new site in the current setting. Search engine traffic, et. al. goes to the old site (www.example-old.com). You want to direct it to the new site (www.example.com). The only place that a 301 redirect will even be possible under those conditions is from www.example-old.com for as long as it is up and running.

The only way you can change this is if you own the old domain name and log in on your registrar's domain control panel and edit your DNS settings to point the traffic for www.example-old.com to your new website www.example.com.

Once you've got this done so that traffic from the old site is hitting your new server, then you can create a URL rewrite that will translate the old site URL to the new site URL with a rule in .htaccess.

As to web content, if it's the same content running on the same software, just copy verbatim from one to the other. You'll have to change any custom .htaccess code and anything else that was server specific to the old system to reflect the domain name change.

share|improve this answer
add comment

If i understand correctly, you need a rewrite rule only for the new site because you have different namings.

If so, the rewrite rule would be like this:

RewriteRule ^(.*).html$ $1/ [nc]

Redirect all file ending with html to the filename as a directory name

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.