301 Problem
-
Hi Guys,
Just have a small problem with a htaccess 301 redirect.
I would like to 301:
www.old-domain.com & old-domain.com
to
The site is exactly the same with the same directory structure so i would also like all the subpages to work. Eg:
www.old-domain.com/folder/page & old-domain.com/folder/page
to
www.new-domain.com/folder/page
Many thanks
-
Great. Thankyou.
-
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]Source:
http://301redirects.net/redirect-old-domain-to-new-website.php
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
-
Is it better to shorten my existing url to use only keyword after domain with a 301 redirect from existing url
I have a long existing URL that has included my key word but the url has about 5 additional words in the text ( eg url would have " /super widgets in stock at the widget store " as url text after domain. keywords is super widget The URL was at the top of search results for my keyword for many years until recently. Is it better to shorten my url text to now use only my keyword " /super-widgets " after the domain with a 301 direct from my existing url to optimize it Thanks
On-Page Optimization | | mrkingsley2 -
Duplicate URL's in Sitemap? Is that a problem?
I submitted a sitemap to on Search Console - but noticed that there are duplicate URLs, is that a problem for Google?
On-Page Optimization | | Luciana_BAH0 -
301 Redirect to product page or category?
We manage an ecommerce website that sells health products. A few products have now been discontinued. I’m just wondering what would be the best practice in this case. Should we 301 redirect to a similar product or to a similar category page? ANY HELP IS GREATLY APPRECIATED!
On-Page Optimization | | odegi0 -
Losing Page Rank after 301 redirect from http to www
Hi Guys I have site-wide redirected all http// to www and all the category pages lost their page ranks (except home page). I would like to know if this is normal and is it one of the possible causes in losing keyword ranking?
On-Page Optimization | | ilovebodykits0 -
Ranking report problem
Hello, I have two things that I'm a little concerned. Ranking report is not working because all these keywords were on google first page but the report is showing the calendar sign Crawl results, I just went from 5000 warnings and errors to 4 in two weeks. It seems a little crazy
On-Page Optimization | | angelowei0 -
Many canonical warnings. Is this a problem?
My site has over 80 canonical warnings. The report states the url is for example http://www.musicliveuk.com and the 'tag value' column says http://www.musicliveuk.com/ Is that a good thing? I'm new to seo and am running my site on wordpress with all in one seo pack. Does this mean the seo pack has automatically added canonical tags to my pages? If so why is it showing as an error? I am also getting lots of 301 permanent redirects and I haven't set any up manually. I'm getting them for every page on my site from the normal url to a url with a slash at the end.
On-Page Optimization | | SamCUK0 -
301 redirects / clean urls
hello everyone, we moved our site to a new platform that has url rewrite feature. we are building out a spreadsheet of the old aspx urls and the corresponding page on the new site. my dev tells me that its not important to redirect the old page to the new "clean url" page which sounds a bit odd to me ..example below. okay. so he says its the same difference to 301 redirect this url: http://72.3.181.97/catalog/DesignerDogBeds.aspx to this urls: https://www.k9electronics.com/product.php?productid=3474 instead of this clean url: http://www.k9electronics.com/designer-dog-beds/ can anyone give me any feedback on this? thanks!
On-Page Optimization | | k9byron0 -
Correct use of Canonical link vs 301 redirect
Hi All, Seeking yet more advice. SEOMOZ tools have told me I have duplicate content on one of my sites and I am keen to clean this up. I am not to familiar with the following so thought I would ask. The duplicate content is shown on : www.mysite.com www.mysite.com/index.html Obviously I only see index.html when I check the code so what is the best method of resolving the duplicate content, Canonical or 301? Can you give me an example 🙂 Thanks all
On-Page Optimization | | wedmonds0