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:



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?

  • It's kinda hard to do 301 redirects without access to the old website.
    – John Conde
    Sep 14, 2011 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.) Sep 14, 2011 at 13:29
  • Different domain name. Sep 14, 2011 at 13:38
  • 1
    As John says, you're stuck. Sep 14, 2011 at 14:32
  • Is the old domain name owned by you? In that case move the domain to the new server. Or have you been cheated by a hosting provider which "sells" domains, but in reality buy the domains in their own name? (Edit: oops, old post)
    – Lenne
    Jul 22, 2016 at 5:45

2 Answers 2


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.


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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