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
-
What should I consider before setting up a sub domain?
Morning all! We've just been approached by IT. They've been asked to develop an online 'portal' where clients can upload and download materials. IT will be developing a portal that sits on the company network perimeter (hosted on our internal servers). The concept is that 3<sup>rd</sup> parties can get and update information in regards to progressing cases, the first use will be for agencies who will retrieve records via the portal and then post reports after a consultation. however I would like to have an automatic link to forward to the portal from the web address: oursite.com/dave We will look to create robot.txt and anything else to prevent from listings/indexes. Does any of the above mess with your SEO? The Directors have asked if they can have this on a sub-domain of our site. Is this wise? And, are there any major SEO considerations for my team to worry about? Better still, have any of you had to deal with this before? If so, what happened? All the best, John
Technical SEO | | Muhammad-Isap0 -
Country Specific Domain
Guyz, we are new startups and have one very simple question regarding domain name. Should we use example.com or example.com.au ? Our Goal initially would be to target customer from Australia and gradually go global. So if we opt for .com.au we may have an edge in terms of local SEO in the beginning but lose out in the long run. What is the best way to tackle this? Thanks
Technical SEO | | WayneRooney0 -
Domain forwarding
Hi Is it ok or bad practice to domain forward shorter more memorable snappier domains used for promoting a website to a longer domain where the website actually lives, such as: Promoting in social media profiles, emails and offline literature a domain with forwarding set up like: www.brand.com To the main website: www.brandincludingprimaryproductrelatedkeyword.com And if ok (not bad practice), since its the forwarded domains that are being promoted they are hence the links most likely to be shared on social media and other websites so will they be treated like 301's and 'link building' for those will pretty much equate to link building for the main domain (or not) ? Many Thanks Dan
Technical SEO | | Dan-Lawrence0 -
Forum on toplevel or sub domain?
Hiya all I am building a site for the expansion of a facebook fan page that will be sending a fair bit of traffic to the site. One feature of the site is a forum plus a store and i have to make the dissuasion on if i should have the forum and store on the main domain or on separate subdomains for each. domain.com forum.domain.com store.domain.com So my question is would it be better to keep all of these elements on the main domain or each on a separate sub domains? Will
Technical SEO | | wildwill0 -
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 -
Redirect link from a particular domain
Hi guys/gals, I have a few domains and blogs which I use really for a bit of fun and experimenting. One of the domains (abc.com) wasn't doing much but has a few decent links built to it. I redirected this domain to an active blog (123.com). Here's the problem: There's a particular external link to the homepage of abc.com which drives a lot of traffic but isn't relevant to the content of 123.com which it redirects to, causing a huge bounce rate from this link. Is there a way (maybe using using htaccess) that I can redirect traffic from this one link to another domain completely? I've contacted the owner of the external site but they are unable (or unwilling) to change the link. I hope I haven't lost you all but shout if you need any clarification. Thanks in advance!
Technical SEO | | Confetti_Wedding0 -
Multiple Domains for One Site
We are building a site for a new miniature golf course. They have a long name, which they don't want me to mention, but it's equivalent to a name like Golden State Golf and Putt. They also have a restaurant with its own name and brand that will be a part of the mini golf course and its website, much how Hotel websites have their restaurants on their sites. Before becoming our client they purchased golfandputt.com and want to go with this domain for simplicity sake. In addition to this domain name they purchased 7 others that contain the bussiness' full name in some way, such as: goldenstategolfandputt.com goldenstategolfandputt.net, goldenstategolf-guitar.com etc., As well as: 3 variations of the golfandputt.com domain 3 variations of the restaurants name They wish to have all of these redirect to the main website or the restaurant page to "help with SEO," as they told me. From what I have researched on SEOmoz it seems better to simply optimize the website for Golden State Golf and Putt and the restaurant page for the restaurant's name. Additionally, I'm worried that redirecting the domains to the site will actually hurt them in rankings. If someone can shed some light on what the best practices for this sort of situation are I'd be much appreciative. Apologies in advance for the lengthy explanation but its a bit of a unique situation.
Technical SEO | | TVI0 -
Old Domain - What to do?
A client recently bought an older domain that is keyword-rich to an aspect of his company. The main website has both e-commerce and call-to-action elements. Our team is split on whether or not to create a micro-site on that domain focused on that aspect of the work that he does or to simply redirect the old domain to his main website. I have not had the opportunity to look at the link profile of the recently acquired domain nor do I have any idea of how many times it's changed hands (which would seem to now be a possible indicator of doorway pages). If any clarification would help, please let me know and I'll do my best to answer.
Technical SEO | | MountainMedia0