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
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
-
Domain not ranking in Google
https://www.buitenspeelgoed.nl/ is a domain acquired by our client. Previously this website was on http://www.buitenspeelgoed-keupink.nl. With the old domain they were ranking top 30 on 'buitenspeelgoed' in google.nl. Now with the new exact match domain they aren't ranking any more (for months). However, the website is indexed, as you can see on http://1l1.be/nz I don't know what to do anymore. Need some advise. What we allready have done the last months: made adjustments to the 301-redirects (this was originaly setup wrong by the webdesigner (de) optimized the homepage on 'buitenspeelgoed' (strange is the fact that the Moz robot can't access the site). Checked the robots.txt to see if the website was blocked for Google Checked the meta robots to see if the website was blocked for Google Disavowed some spammy (old) links which linked to the old domain Checked Search console > Fetch as Google if there isn't any Malware of some kind (and to see if Google can access the site) Checked Search consol to see if there manual spam actions (isn't the case) Checked for duplicate content by copy/paste some texts in Google and see if any other results are showing up (isn't the case for most of the texts) Please let me know what we can do.
Technical SEO | | InventusOnline0 -
Blogging on multiple domains
We have three different domains for geotargeting (za,uk and .com). Each site at at the moment has the same content with only country specific details changed like currency etc. What is the best way to get maximum SEO benefit when posting new content.When we post new content should we repost to all three domains (the same content) or will Google only index the url on the domain which is crawled first. Thanks in advance
Technical SEO | | aquaspressovending0 -
Redirecting a Few URLS from One Domain to Another
Hello, I have two websites within a similar niche...some of the top organic traffic driving pages on Website B I'd like to redirect to a similar page on Website A. The reason is Website A is a bigger and better and is monetized much better as well. I only want to redirect a few of the main URLS on Website A and also only those that I have similar content on my main Website B. Is this process safe for SEO? What is the best way to go about this process. I am not really concerned with Website B and what happens to it's rankings, but in the meantime, I'd like to redirect the traffic from some of it's main organic traffic driving pages to my main website A and to it's similar pages. I am also concerned with making sure my main website A stays white hat and doesn't receive any negativity from these redirects. Thanks.
Technical SEO | | juicyresults0 -
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 -
Domain Hosting
I'm currently working with a client who provides products in Ireland Is it massively beneficial for the sited to be hosted on an irish server or will there not be much difference with it being hosted in England?
Technical SEO | | Sandeep_Matharu0 -
Localized domains and duplicate content
Hey guys, In my company we are launching a new website and there's an issue it's been bothering me for a while. I'm sure you guys can help me out. I already have a website, let's say ABC.com I'm preparing a localized version of that website for the uk so we'll launch ABC.co.uk Basically the websites are going to be exactly the same with the difference of the homepage. They have a slightly different proposition. Using GeoIP I will redirect the UK traffic to ABC.co.uk and the rest of the traffic will still visit .com website. May google penalize this? The site itself it will be almost the same but the homepage. This may count as duplicate content even if I'm geo-targeting different regions so they will never overlap. Thanks in advance for you advice
Technical SEO | | fabrizzio0 -
My Old Domain is Not Changing in Google
I have taken over the following domain www.choice-cottages.co.uk, part of the contract was to re-direct the old site www.choicecottages.info to the new site. Unfortunately I am only a middle man in the arrangement as the website is hosted with another company. The switch was done well over 4 weeks ago, the re-direct itself is working fine. However if you google choice cottages you will see the first listing is www.choicecottages.info, then I have my new site below for a few listings. Google is definitely updating something as before the old domain had lots of site links but this has reduced to a few. Does anyone know anything on this, as in the past it only takes a couple of days to update. Many thanks Andy
Technical SEO | | iprosoftware0 -
Question about domain redirects
One of my clients has an odd domain redirect situation. See if you can get your head round this: Domain A is set-up as a domain alias of Domain B Entering domain A or domain B takes you to default.asp on domain B. The default.asp includes VB script to check the HTTP_HOST variable. It checks whether the main doman name for domain A is present in the HTTP_HOST and if so redirects it to domain A/sub-folder/index.htm. If not present it redirects to domain B/index.htm. In both cases the redirect uses a response.Redirect clause. I think what is trying to be achieved is to redirect requests to Domain A to a sub-folder of Domain B. It works but seems extremely convoluted. Can anyone see problems with this set-up? Will link juice be lost along the redirect paths?
Technical SEO | | bjalc20110