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
-
Change theme or domain first?
I bought a new domain and I want to use it instead of my current domain for my website. I also want to change my theme. Which should I do first? At the time I have my new domain forwarded to my current domain.
Technical SEO | | tfuentez0 -
Domain Migration Information
Hi, We are in the process of switching from *.net to *.com and I am looking for some resources on this. Any suggestions?
Technical SEO | | EcomLkwd0 -
One large site or a few microsites?
Hi, I have a client who runs a professional expo company and wants to redo his website. Right now he has one website that has the following sections: expo company info, wedding show info, electrical wire show info, fishing show info. My question is, when I rebuild the site would it be better to do one site or four microsites?
Technical SEO | | JohnWeb120 -
One Keyword Penalty
Hi There, Quick question for everyone. Is it possible to get penalized a keyword level not page level. I have a site that only seems to be penalized on one keyword which is currently at page 22, whilst the rest are on page 1 or page 2. I came to the site late so I have no idea when the site lost its ranking for this keyword after a site redesign but the onpage is almost the same. Kind Regards Neil
Technical SEO | | nezona0 -
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 -
Country domain: Seo for other languages
Hi, I have an italian domain (.it) for an italian hotel, it is an old authoritative domain (1997) and it is well optimized for the keywords that include the city the hotel is in, now the page is decently positioned in Google Italy. There are many problems to have the same rank for German version (in google.de, google.at). The German version is in the /de folder. The hotel has another .com domain, much less authoritative (2007), in a German server, but it was and is only a simple redirect 301 (by code) to the German version in the .it domain. (obviously the rank for this domain is almost nonexistent). Do you have any suggestion? Thank you.
Technical SEO | | depi0 -
Sub Domain SEO
I am thinking to Add Sub Domains to get better rankings for Local Searches. So I will develop City Specific Sites with Specific Language. For Example qatar.wisnetsol.com. IT will be in Arabic. If my Good standing and Ranking on Google for wisnetsol.com will help my subdomain to rank better? if we setup wisnetsol.com/qatar, how it can target Qatar in Google Webmaster tools? Will links for qatar.wisnetsol.com and wisnetsol.com are seprate? What do you think about this strategy? Is it good or bad?
Technical SEO | | Khuram0