: Using 301 Redirects on new site when access to old site denied? 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
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:
oldsite.comaboutus www.newsite.comaboutus.html
newsite.comproductx.html www.oldsite.comproductx
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?
More posts by @Sent6035632
2 Comments
Sorted by latest first Latest Oldest Best
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 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 example-old.com to your new website 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$ / [nc]
Redirect all file ending with html to the filename as a directory name
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.