Rewrite rules from one domain to another one
-
I have moved he site from a server to another one, changing the domain name. The page names are the same, so in every urls you will have only a differnce in the domain name not in the rest of url.
I would like to use rewriterule in the htaccess file to tell to everyone, especially to search engines, that I have now new urls.
I have found this code, but I'm not sure it could be the right one in my case
RewriteEngine On RewriteRule ^(.+)$ http://nuovodominio/$1 [R=301]
Thanks to anyone could help me. Ciao, bob
-
Very helpful Robert. Thank you and ciao. Bob
-
Bobrock4
First, you need to 301 url to url as a best practice. Second, you need to understand that the more difficult issue is you changed domain name and that may cause Google, etc. to take a little longer to credit the 301 (due to bad practices in the past). That said, there is a great resource on moz that considers whether you are on a LAMP stack or microsoft, etc.
The link is in Learn SEO and is better than just giving you a rewrite rule as it will allow you to comprehend what is happening and why.
I hope you find this helpful.
Robert
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
-
Reason for reducing site authority domain?
Hi;
Technical SEO | | 5mizo
I have a website that had an authoritative domain of 10 but today it has reached 5. I wanted to know what the reason for these changes was.
No backlinks from my site have disappeared and even more, but today my authoritative domain has reached 5 authoritative domain.
Can you guide my servant? My website to troubleshoot : bonianservice.com Thank you very much mxyv_untitled-2.jpg0 -
How to handle one section of duplicate content
Hi guys, i'm wondering if I can get some best practice advice in preparation for launching our new e-commerce website. For the new website we are creating location pages with a description and things to do which will lead the user to hotels in the location. For each hotel page which relates to the location we will have the same 'Things to do' content. This is what the content will look like on each page: Location page Location title (1-3 words) Location description (150-200 words) Things to do (200-250 words) Reasons to visit location (15 words) Hotel page Hotel name and address (10 words) Short description (25 words) Reasons to book hotel (15 words) Hotel description (100-200 words) Friendly message why to visit (15 words) Hotel reviews feed from trust pilot Types of break and information (100-200 words) Things to do (200-250 words) My question is how much will we penalised for having the same 'Things to do' content on say up to 10 hotels + 1 location page? In an ideal world we want to develop a piece of code which tells search engines that the original content lies on the location page but this will not be possible before we go live. I'm unsure whether we should just go and take the potential loss in traffic or remove the 'Things to do' section on hotel pages until we develop the piece of code?
Technical SEO | | CHGLTD1 -
Spammers created bad links to old hacked domain, now redirected to our new domain. Advice?
My client had an old site hacked (let's call it "myolddomain.com") and the hackers created many links in other hacked sites with links such as http://myolddomain.com/styless.asp?jordan-12-taxi-kids-cheap-T8927.html The old myolddomain.com site was redirected to a different new site since then, but we still see over a thousand spam links showing up in the new site's Search Console 404 crawl errors report. Also, using the links: operator in google search, we see many results of spam links. Should we be worried about these bad links pointing to our old site and redirecting to 404s on the new site? What is the best recommendation to clean them up? Ignore? 410s? Other? I'm seeing conflicting advice out there. The old site is hosted by the client's previous web developer who doesn't want to clean anything up on their end without an ongoing hosting contract. So beyond turning redirects on or off, the client doesn't want to pay for any additional hosting. So we don't have much control over anything related to "myolddomain.com". 😞 Thanks in advance for any assistance!
Technical SEO | | usDragons0 -
One simply question about disavow tool
Hi Guys, my website is under a negative seo attack. One simply question about disavow tools. Everyday I have to upload a file with the new bad backlinks (domains). The fact is that when I try to upload a new disavow report the tool continue to show me the file of the day before and If I upload the new file it replace the old one. So.... what I have to do? 1. Upload a new file with the backlink domain of the day that replace the old one
Technical SEO | | Italianseolover
2. Or upload a new file with the old backlinks plus the new one? Thank you very much.0 -
Hit by a penalty? But which one?
Hi guys, First off, thanks for reading my post! My site, www.doctorloanusa.com suffered a massive drop in Google rankings and traffic on September 27. For the past 4 years, I've ranked in spots 1-3. My main keywords are physician loans and doctor loans. I had a competitor copy almost ALL my text. In early October, I filed a DMCA takedown and had the infringing site removed from the SERPS. I also made text changes to my site. I thought this duplicate content was the problem, but I have yet to see any improvements 2 months later. My site isn't particularly deep content-wise, but it's competitive with others in my niche. I have relatively few links but others in the SERPS have very similar link profiles. I tried to clean up a few questionable links and used the disavow tool. I have used the SEOmoz on-page tools to grade my site. Typically, I receive grade A reports. I still rank for my website URL, and still rank 1 in both Yahoo and Bing. My bounce rate is 43%. If anyone could provide insight, I would be very grateful. I need to get this site ranking again, as this property is my main source of income. Is the site over-optimized? Is it my anchor text profile? Thank you very much in advance!
Technical SEO | | Cary_Forest0 -
To 301 redirect or not to 301 redirect? duplicate content problem www.domain.com and www.domain.com/en/
Hello, If your website is getting flagged for duplicate content from your main domain www.domain.com and your multilingual english domain www.domain.com/en/ is it wise to 301 redirect the english multilingual website to the main site? Please advise. We've recently installed the joomish component to one of our joomla websites in an effort to streamline a spanish translation of the website. The translation was a success and the new spanish webpages were indexed but unfortunately one of the web developers enabled the english part of the component and some english webpages were also indexed under the multilingual english domain www.domain.com/en/ and that flagged us for duplicate content. I added a 301 redirect to redirect all visitors from the www.domain/en/ webpages to the main www.domain.com/ webpages. But is that the proper way of handling this problem? Please advise.
Technical SEO | | Chris-CA0 -
I am Posting an article on my site and another site has asked to use the same article - Is this a duplicate content issue with google if i am the creator of the content and will it penalize our sites - or one more than the other??
I operate an ecommerce site for outdoor gear and was invited to guest post on a popular blog (not my site) for a trip i had been on. I wrote the aritcle for them and i also will post this same article on my website. Is this a dup content problem with google? and or the other site? Any Help. Also if i wanted to post this same article to 1 or 2 other blogs as long as they link back to me as the author of the article
Technical SEO | | isle_surf0 -
Merging two sites into one
I have two websites, www.joecline.com and www.affinityproperties.com. Originally, I wanted joecline.com to be focused on west austin only. I now realize that I only have time to really handle the promotion of one site. I'm wondering SEOwise, which url would be better to keep. I would consolidate all content on one site and 301 the migrated site to the new URLs in the domain which I would keep. Any ideas would be great. Thanks Joe
Technical SEO | | simplesimon0