301 domain name to another site
-
I had 2 websites. I decided not to maintain one of them and set it to 301 to my main website. However, i see people getting 404 errors when they land on my main website but with a page name from the old site. How can I set things so that anyone who tries to go to the old site goes to my homepage of my main site?
http://oldsiteB.com/oldpagename sends them to http://siteA.com//oldpagename = 404 - I want them to go directly to homepage on siteA.
-
Try to put that .htaccess on the old site. It will rewrite the asked URL before it can be processed by the server. It will rewrite the request to contain the new domain.
On the new domain, you already have the code to process these requests.
Try that and report back. It probably works after that.
-
No, I put it on the .htaccess on the new site. I had 301'd the whole old site in my domain name manager. Maybe I should not do that so I can put an .htaccess file right on the old domain?
-
Ok, just to be sure: you have placed this .htaccess on the old site. Right?
If that is the case and you've pasted the exact code i mentioned, then something else might be causing the issue.
Also: be sure to try this with a browser that hasn't visited the site in a while. It happens to me sometimes that the browser will simply remember the redirect and not follow the .htaccess.
Hope any of this helps!
-
Actually, I tried that, and the result is still
Old URL: "www.myoldsite.com/my-page/"
New URL: "www.mynewsite.com/404.html -
Yes, that helps, thank you!
-
Ok so i had to test this one because i wasn't sure but you would have to remove "$1" from the last line.
That piece actually will add the file path of the original domain and add it to the domain you are redirecting the visitor to.
So this "www.myoldsite.com/my-page/"
Will become "www.mynewsite.com/my-page/"Since you want it this way:
Old URL: "www.myoldsite.com/my-page/"
New URL: "www.mynewsite.com/"Removing the "$1" should do the trick.
Is this an answer to your question?
Bas
-
Can I use this option and somehow direct all traffic from old site to my new home page? I tried this and if someone was trying to find a specific page on the old site they get a 404 on the new.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^OLDSITE.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.OLDSITE.com [NC]
RewriteRule ^(.*)$ http://NEWSITE/$1 [L,R=301,NC] -
Hi,
You have 2 methods that i would use:
Method #1: using .htaccess
Option A: redirect one specific URL to a new specific URL:
Redirect 301 /old/old.html http://NEWSITE/new.htmlNote: 'old/old.html' has to be without the domain name: so just the directory + page.
Option B: redirect an entire directory to a new specific URL:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^OLDSITE.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.OLDSITE.com [NC]
RewriteRule ^(.*)$ http://NEWSITE/$1 [L,R=301,NC]Note: the second line of that example has to be without 'www'.
Method #2: using PHP
If you have one header-file, you can place this code in the top of that php-file:
header( "Status: 301 Moved Permanently" ); header( "Location: http://NEWSITE" ); exit(0); ?>Would that provide an answer for you?
Yours,
Bas
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
-
Recently migrated to https version of volusion site. 301 redirect link chain question
I recently migrated to a https version of a volusion site. They have some type of internal 301 redirect method to accommodate for the entire site. I have also used the 301 redirect manager to redirect categories and pages which I have changed. The question is if I have changed a page internally in the redirect manager from say source. /bluewidget to say. target. /superbluewidget is it wiser or even possible to do it this way to reduce the redirect chain from 3 to 2 steps source. /bluewidget to. target https://www.example/superbluewidget can a relative link be targeted to a full url to reduce steps in a 301 redirect link chain. Thanks
Technical SEO | | mrkingsley0 -
I need help with redirecting chain to another page and 301, I don't understand on how to fix
Redirect Chain <label>What it is:</label> Your page is redirecting to a page that is redirecting to a page that is redirecting to a page... and so on. Learn more about redirection best practices. <label>Why it's an issue:</label> Every redirect hop loses link equity and offers a poor user experience, which will negatively impact your rankings. <label>How to fix it:</label> Chiaryn says: “Redirect chains are often caused when multiple redirect rules pile up, such as redirecting a 'www' to non-www URL or a non-secure page to a secure/https: page. Look for any recurring chains that could be rewritten as a single rule. Be particularly careful with 301/302 chains in any combination, as the 302 in the mix could disrupt the ability of the 301 to pass link equity.” This is not helping me I don't understand about the 301 do I use the www.jasperartisanjewelry.com or the /jasperartisanjewelry.com I'm confused
Technical SEO | | geanmitch0 -
To 301 or not to 301?
So, to cut a long story short, on our website we have a /product page that is very similar to our homepage and doesn't really serve much of a purpose. It doesn't really fit in with the rest of the website and our directors want to get rid of it and focus our efforts on our homepage. Problem is, the /product page has a little bit of PA and links to other important pages on the website. I personally don't want to completely cut this page off. Would a 301 redirect to the homepage be a good option or would I be better off redirecting users to our course library page (Our course pages are what bring in most of our organic traffic)? Any help or other suggestions would be appreciated here! http://www.ihasco.co.uk/
Technical SEO | | iHasco1 -
Value of domain name for domain authority. Please help to figure out!
I am doing SEO for an appliance repair company. Their company website's domain doesn't have high authority, and I am going to increase that by link earning and content improving. I think a better domain name might also help me out. The current URL contain the word "appliance" but doesn't have "repair" in it. I am thinking a new domain that would contain both keywords will serve better. Could you please share with me your thought on this? Am I in the right direction, or not at all? I know Google penalizes mirror sites since this they are considered as duplicated content. I'll upload my content to the new domain and make the old one point to that new URL. I am wondering if canonical might help? Or 301 redirect will be a better solution? Any advise would be highly appreciated! Thank you!
Technical SEO | | kirupa0 -
Moving a website from one domain to another
Hi Guys, I figured I'd investigate this fully before potentially ruining a client's traffic. The rundown:Two websites; one is an ecommerce store and the other is just a brochure website which has references to the ecommerce store. The ecommerce store is hosted on a server we control whereas the brochure one isn't, the URL for the brochure store is nice and simple which is the reason for the switch, as the ecommerce URL is very long and hard to remember. Now from an SEO point of view will it be a case of 301 redirecting every URL from the old domain name to the new one one or is there an easier option? Any tips or links to more information would be much appreciated. Thanks, Dan
Technical SEO | | Sparkstone0 -
Will Links to one Sub-Domain on a Site hurt a different Sub-Domain on the same site by affecting the Quality of the Root Domain?
Hi, I work for a SaaS company which uses two different subdomains on our site. A public for our main site (which we want to rank in SERPs for), and a secure subdomain, which is the portal for our customers to access our services (which we don't want to rank for) . Recently I realized that by using our product, our customers are creating large amounts of low quality links to our secure subdomain and I'm concerned that this might affect our public subdomain by bringing down the overall Authority of our root domain. Is this a legitimate concern? Has anyone ever worked through a similar situation? any help is appreciated!
Technical SEO | | ifbyphone0 -
Linking Domains in Open Site Explorer Report No Longer Exist. Help.
Hello to all, I have a number of Linking Domains on our Open Site Explorer Report that no longer exist. I've run URL checks on just a sample of the list, and found that approx. 35% of that sample are from now dead Linking Domains. Can someone help? If these Linking Domains are defunct, how can I remove these? Does Google reflect negatively on these dead Linking Domains in our SERPs? Has anyone experienced this before? What action did you take?
Technical SEO | | -Al-0 -
Multiple Domains, Same IP address, redirecting to preferred domain (301) -site is still indexed under wrong domains
Due to acquisitions over time and the merging of many microsites into one major site, we currently have 20+ TLD's pointing to the same IP address as our "preferred domain:" for our consolidated website http://goo.gl/gH33w. They are all set up as 301 redirects on apache - including both the www and non www versions. When we launched this consolidated website, (April 2010) we accidentally left the settings of our site open to accept any of our domains on the same IP. This was later fixed but unfortunately Google indexed our site under multiple of these URL's (ignoring the redirects) using the same content from our main website but swapping out the domain. We added some additional redirects on apache to redirect these individual pages pages indexed under the wrong domain to the same page under our main domain http://goo.gl/gH33w. This seemed to help resolve the issue and moved hundreds of pages off the index. However, in December of 2010 we made significant changes in our external dns for our ip addresses and now since December, we see pages indexed under these redirecting domains on the rise again. If you do a search query of : site:laboratoryid.com you will see a few hundred examples of pages indexed under the wrong domain. When you click on the link, it does redirect to the same page but under the preferred domain. So the redirect is working and has been confirmed as 301. But for some reason Google continues to crawl our site and index under this incorrect domains. Why is this? Is there a setting we are missing? These domain level and page level redirects should be decreasing the pages being indexed under the wrong domain but it appears it is doing the reverse. All of these old domains currently point to our production IP address where are preferred domain is also pointing. Could this be the issue? None of the pages indexed today are from the old version of these sites. They only seem to be the new content from the new site but not under the preferred domain. Any insight would be much appreciated because we have tried many things without success to get this resolved.
Technical SEO | | sboelter0