How Can I Redirect an Old Domain to Our New Domain in .htaccess?
-
There is an old version of http://chesapeakeregional.com still floating around the web here: http://www.dev3.com.php53-24.dfw1-2.websitetestlink.com/component/content/category/20-our-services. Various iterations of this domain pop up when I do certain site:searches and for some queries as well (such as "Diagnostic Center of Chesapeake").
About 3 months ago the websitetestlink site had files and a fully functional navigation but now it mostly returns 404 or 500 errors. I'd like to redirect the site to our newer site, but don't believe I can do that in chesapeakeregional.com's .htaccess file. Is that so and would I need access to the websitetestlink .htaccess to forward the domain?
Note* I (nor anyone else in our organization) has the login for the old site. The new site went live about 9 months before I arrived at the organization and I've been slowly putting the pieces together since arriving.
-
Sorry Sean, I misunderstood your question. No, you cannot redirect any website you don't have access to. My recommendation would be to contact the host and work with them to obtain access. It's usually not a complex process.
-
Hi Brett,
I've tried the above and previously found the InMotion Hosting resource. I'm able to redirect pages on chesapeakeregional.com just fine. I believe I cannot do the above in the ches reg .htacess because the site I want to redirect from is a different domain. If I could, there wouldn't be anything to stop anyone from redirecting, say facebook.com, to their own website...unless I'm misunderstanding something.
-
There are several resources around the net that show how to do this. Here's a code snippet provided by http://www.inmotionhosting.com/support/website/redirects/setting-up-a-301-permanent-redirect-via-htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ http://example.net/$1 [L,R=301,NC]If this doesn't work for you, here are some other resources:
https://www.internetmarketingninjas.com/blog/search-engine-optimization/301-redirects/
https://css-tricks.com/snippets/htaccess/301-redirects/
http://www.bruceclay.com/blog/how-to-properly-implement-a-301-redirect/The first code example is more canonical friendly. The simple version I see used a lot and recommended in the other resources I've provided looks like this:
RedirectMatch 301 ^(.*)$ http://www.xyz.com
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Reuse an old juicy URL or create a new with the best practices?
I'm optimizing a site with all new URL`s, categories, titles, descriptions. All URL's will change but I've old URLs with a lot of backlinks, SEO juice. What is better for SEO with them: 1 - Change those URLs and 301 redirect traffic to the new page.
Intermediate & Advanced SEO | | Tiedemann_Anselm
2 - Keep the URL and work just on new title, description, etc. In option 1 I understand that I'll lose some SEO juice because of the redirect, but the new URL will be correct. In option 2 everything will be strong except from the URL that will make less sense than with option 1. It will not exactly match the product name, title. It`s a reuse of a strong URL.0 -
How do I redirect my old PHP website to my new Java website?
Please could you help? My old website is written in php. I've created a new design of the website in Java. I'll be using the same domain name though. example.com and I'd like to pass my link juice to my new redesigned website. When I turn the domain name to point to my new website how do I make sure pages that are ranked in google that don't exist on my new website transfer 301 from my old website to a similar page on my new website. Old Website Example example.com/bootcampuk.php New Website Example example.com/bootcamps.jsp Many Thanks, Rob
Intermediate & Advanced SEO | | puamethod0 -
New domain or subdirectory?
I noticed my domain authority has dropped slightly in the recent update, and it has me re-thinking a strategy for a website I just recently launched. I purchased the domain name kansasisbeautiful.com about a year ago and have been working on building it for most of that time. Earlier in August, I went ahead and launched it. However, towards the end of the development of the website, I decided to just put it in a subdirectory of my parent company (my photography business) at mickeyshannon.com/kansas and redirected the kansasisbeautiful.com domain to the subdirectory. mickeyshannon.com is my photography business website. The Kansas website has it's own distinct design, but is powered completely by my photography. I created it for a few purposes, including promoting tourism to the state of Kansas and to publish a book on Kansas travel next year, but one of it's main goals is also to help sell my photography prints. I decided to put it in a subdirectory (mickeyshannon.com/kansas) as I had hoped it might drive more traffic into buying photo prints if it lived on my main website. However, I've been re-thinking my strategy and have been wondering if I'm competing against myself too much. Many of my photography prints have the name of a location in them and have their own URL per photo (for example: "Flint Hills Spring Sunrise" is at http://www.mickeyshannon.com/photo/flint-hills-spring-sunset/). It makes me wonder if the new Kansas travel website page for the Flint Hills (http://www.mickeyshannon.com/kansas/flint-hills/) is competing for that keyword. Would I be better moving mickeyshannon.com/kansas to kansasisbeautiful.com? I was worried having so many backlinks back to my photography site would send up red flags with Google as if the kansasisbeautiful.com website was just a spammy website created to push traffic to mickeyshannon.com when it really has it's own purpose. Any thoughts on whether using the domain name or keeping it at the subdomain level is better? Hopefully that made sense. Thanks, Mickey
Intermediate & Advanced SEO | | VSphoto0 -
Changing domain names but still ranking as old one
Hi there, I have a client who changed domain names back in November 2015 but is still coming up in search engines with their old domain name not their new one. For example, I search for my clients name, let's call them Example B. So I search for "Example B" and within the search results they come up top and the title tag is correct as it says something along the lines of "Welcome to Example B". However the URL underneath is actually their old name which is Example A. When you click on the link, it redirects over to the new name so thats fine, but it's just annoying that Example A is still appearing when it should be Example B now. I don't think they have a new Webmaster Tools account setup for their new domain (I need to check still), but they do still have their old one setup. Is there something I can do within Webmaster Tools to tell it that Example A is now gone and to start indexing and referring to them as Example B? What else should I do to make sure their new name is coming up not their old one anymore?
Intermediate & Advanced SEO | | Virginia-Girtz1 -
Penguin hit Website - Moving to new domain
Hey! I am working on a Penguin hit Website. Still ranking for all brand keywords and blog articles are still being returned in Google SERPs, but the website is showing up for only 3 or 4 money keywords. It is clearly a penguin hit as it was ranked 1st page for all money keywords before latest update (3.0). We already did a link cleanup and disavowed all bad backlinks. Still, the recovery process could take over 2 years from previous experience, and in 2 years, the site will suffer a slow death. Solution: We own the .com version of the domain, currently being served on the .net. We bought the .com version about 6 years ago, it is clean and NOT redirected to the .net (actual site). We were thinking about moving the whole Website to the .com version to start over. However, we need to make sure Google doesn't connect the 2 sites (no pagerank flow). Of course Google will notice is the same content, but there won't be any pagerank flowing from the old site to the new one. For this, we thought about the following steps: Block Googlebot (and only googlebot) for the .net version via robots.txt. Wait until Google removes all URLs from the index. Move content to the .com version. Set a 301 redirect from .net to .com (without EVER removing the block on googlebot). Thoughts? Has anyone went over this before? Other ideas? Thanks!
Intermediate & Advanced SEO | | FedeEinhorn0 -
Buying Domains from an auction and 301 redirecting to your new site.
Lets say I have a website in not to competitive niche. I was considering buying a few aged domains from godaddy auctions and 301 redirecting them to my new domain. Can this alone be enough to rank pretty high for a uncompetitive niche? Can this also be a link building technique in itself since the link juice from the domain purchased carries over? Thanks
Intermediate & Advanced SEO | | junkcars0 -
Redirecting 2 aged site to brand spanking new one
Does 301 redircting 2 aged domain to a new one have a compounding effect? Ive redirected domain #1 to teh new site and my new domain has now jumped to position 6 on Google for the keyword. I have noticed that the sites above me are all aged domains and some with very few backlinks. Number 1 is 4 years old and 20 backlinks, thats it! I am wondering, if I redirected a 11 year old domain that is in the same niche, but never really targeteed that same keyword, would that bump my site even higher? Obviously i am building quality backlinks to the new domain and making sure these are hard to get high quality backlinks. Thanks for your help guys
Intermediate & Advanced SEO | | JohnPeters0 -
Redirect old broken link or ask for HREF change?
found some broken links from 2007 to our site pointing to a url that needs a redirect. Obviously I am going to set that up (in-case there are others out there i don't find pointing to the same URL) but should i also reach out to the webmaster and ask him to update the link, or will the redirect suffice? I don't want it to look like a paid link when in fact it is completely natural 🙂
Intermediate & Advanced SEO | | imageworks-2612900