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
-
Migrating Subfolder content to New domain Safely
Hello everyone, I'm currently facing a challenging situation and would greatly appreciate your expertise and guidance. I own a website, maniflexa.com, primarily focused on the digital agency niche. About 3 months ago, I created a subfolder, maniflexa.com/emploi/, dedicated to job listings which is a completely different niche. The subfolder has around 120 posts and pages. Unfortunately, since I created the subfolder, the rankings of my main site have been negatively impacted. I was previously ranking #1 for all local digital services keywords, but now, only 2 out of 16 keywords have maintained their positions. Other pages have dropped to positions 30 and beyond. I'm considering a solution and would like your advice: I'm planning to purchase a new domain and migrate the content from maniflexa.com/emploi/ to newdomain.com. However, I want to ensure a smooth migration without affecting the main domain maniflexa.com rankings and losing backlinks from maniflexa.com/emploi/ pages. Is moving the subfolder content to a new domain a viable solution? And how can I effectively redirect all pages from the subfolder to the new domain while preserving page ranks and backlinks?
Intermediate & Advanced SEO | | davidifaso
I wish they did, but GSC doesn't offer a solution to migration content from subfolder to a new domain. 😢 Help a fellow Mozer. Thanks for giving a hand.0 -
Phasing in new website - new content on www2
Hi Mozzers, I'm working on a large website redesign / redevelopment project. New sections of the website will be phased in over the next 12 months. The plan is to launch all new content on a subdomain (www2.domain.com) while the old site remains on www.domain.com. There will be no duplicate content across the www and www2 sites, as old content will be removed on www as it is replaced with new content on www2. 301 redirects will also be setup from old content on www to new content on www2. Once the new site on www2 is complete, everything will be moved to www, with a robust 301 redirect setup in place. Is this approach logical, and can you see any SEO implication for managing the migration in this way? Thanks!
Intermediate & Advanced SEO | | RWesley0 -
Should I redirect a domain we control but which has been labeled 'toxic' or just shut it down?
Hi Mozzers: We recently launched a site for a client which involved bringing in and redirecting content which formerly had been hosted on different domains. One of these domains still existed and we have yet to bring over the content from it. It has also been flagged as a suspicious/toxic backlink source to our new domain. Would I be wise to redirect this old domain or should I just shut it down? None of the pages seem to have particular equity as link sources. Part of me is asking myself 'Why would we redirect a domain deemed toxic, why not just shut it down.' Thanks in advance, dave
Intermediate & Advanced SEO | | Daaveey0 -
What happens to a domain in SERPs when it's set to redirect to another?
We have just acquired a competing website and are wondering whether to leave it running as is for now, or set the domain to redirect to our own site. If we set up this redirect, what would happen to the old site in Google SERPs? Would the site drop off from results? If so, would we capture this new search traffic or is it a free for all and all sites compete for the search traffic as normal? Thanks in advance. Paul
Intermediate & Advanced SEO | | kevinliao0 -
Redirect multiple domains to a primary domain
Hello that such I make the following query imagine we have three domains on the same thematic or category primary domain: domain-antiguo1.com (3 years) (200 Backlink), domain-antiguo2.net (10 years) (1000 Backlinks) and domain-antiguo3.com (6 years) (500 Backlinks) and decide to redirect all these domains favorite one: domain-principal.com The three domains registered refeccionar this google webmaster, has its respective income sitemap and google webmaster area change of address to the main domain the three domains are my property It would have a penalty for doing this practice?
Intermediate & Advanced SEO | | globotec0 -
New Website Look/Structure - Should I Redirect or Update Pages w/ Quality Inbound Links
This questing is regarding an ecommerce website that I hand wrote(html) in 1997. One of the first click and buy websites, with cart/admin system that I also developed. After all this time, the Old plain HTML look just doesnt cut it. I just updated to XHTML w/ a very modern look, and believe the structured data will index better. All products and current category pages will have the identical vrls taken from the old version. I decided to go with the switch after manual penalty, which has since been removed... I figured now is the time to update. My big question is that over the years, a lot of my backlinks came from products/news that are either no longer relevant or just not available. The pages do exist, but can only be found from the Outbound Link Source. For SEO purposes, I have thought a few things I can do but can't decide which one is the best choice. Any Insight or suggestions would be Awesome! 1. Redirect the old link to the most relevant page in my current catalog. 2. Add my new header/footer to old page(this will add a navigation bar w/ brands/cats/etc) 3. Simply add a nice new image to the top of these pages linking home & update any broken/irrelevant links. I was also considering adding just the very top 2 inches of my header(logo,search box, phone, address) *note, some of these pages do receive some traffic. Nothing huge, but consider the 50+ pages, it ads up.
Intermediate & Advanced SEO | | Southbay_Carnivorous_Plants0 -
Redirecting a Page from Domain A to Domain B
We have a page on Domain A, an established and well-ranking website, that would be more appropriate on Domain B, a site that we launched about two years ago. This page ranks well, pulls nice search traffic and has traffic from external links. We would like to move the page and its traffic from Domain A to Domain B using a 301 redirect. Have you ever done this or have you heard of how it has worked for someone else? Thanks!
Intermediate & Advanced SEO | | EGOL0 -
Moving to a new domain
We currently rank well in our niche on a long (and ambiguous) domain, but want to rebrand and have a shorter and more memorable domain. Keeping in mind we're already pointing good links at the new domain (301ing them to the old site), how long should we age the domain before switching the content and 301ing the old site?
Intermediate & Advanced SEO | | errspy0