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
-
Rewrite a good post
Hello I have a blog post from 2015 that is ranking very well on Google but I have a terrible bounce rate of more than 98% for this landing page. This post is bringing 4 more visits than the rest of my website pages so I need to make people stay in the site. I don't want to lose my rankings so my question is: Is it better to modify this post or to write a new post and delete the old one? Thank you
Technical SEO | | seoandromedical0 -
I have one keyword which disappeared
My site currently ranks for over 2000 of which 92 are in the number 1 position. Im very active with this site. My Main keyword is a two word keyword ,I have never been below the position #30. Has always been at best 3rd and fourth page. I rank primarily for mostly 3 part keywords and 4 part keywords. However , I noticed about a month ago,The main keyword no longer showing up on serp tools .Moz included. At first i was getting wierd results using keyword tool .Not moz serp tool. I would get different result every time i checked it. When i tried to verify these results ,Only to find my site not at the projected page and rank. After more than a month now this particular keyword is no where in site. Im still getting traffic fom all the other keywords but im a bit confused over this. I thought my main keyword was about to be on the bottom of the 2nd page but instead seems to be completely gone.
Technical SEO | | Yellow20000 -
How do I fix a multiple domain mess?
I just picked up an account that is a franchisee and they have 6 exact match domains plus their main domain (all exact duplicates, not 301s). GA shows the main domain as getting the lion's share of hits, but for some important local keywords, the exact match domains rank higher. Some pages may have the exact match domain, primary domain and the franchise domain all ranking on the same SERP. Yuk! My strategy is to work on the main domain and as the work progresses, the main site will surpass the exact match domains and main franchise domain for the important searches. For the exact match domains I plan on just leaving them alone. Is this a sound strategy? I could pull the exact match domains down, but since they rank well for their keywords, it seems most sensible to leave them up. What do you think?
Technical SEO | | KristinnD0 -
Domain Forwarding Help
A friend of mine is a domainer and he wants to forward 21 parked niche specific domains to my site for extra type-in traffic. This will turn out to be 30 extra hits a day. Obviously, since these are parked domains, the SEO benefits are none, we just want the traffic. My questions is how to do it. These are his parked domains, and will not be redirected forever, is a 302 redirect the best plan here? He planned on just going into his hosting/domain admin and selecting "forward domain" -- is this ok too? Also, he would prefer to forward these domains to a single domain he owns, and then forward that single domain he owns to my domain. So someone who types in one of these 21 domains will go typindomain.com ---> hisredirectsite.com ---->mysite.com any implications here? What is the best option and how to do it? Thanks
Technical SEO | | terran0 -
Preferred domain registrar AU
I need to register a domain in Australia. Does anybody have a trusted domain registrar I can go to? The person in our Australian office gave me a list of registrars she found where she can purchase the domain, but I wanted to see if anyone here had recommendations.
Technical SEO | | spackle0 -
Redirecting Parked Domain
I just recently switched hosting. We have 3 domains and 1 being the main domain. Right now they are set up as parked domains. Can I redirect the parked domains under my main websites .htaccess file ? I am just worried that good we will get hit for duplicate content, even though technically the content is only on our main domain. right now if I type in my parked domains in Google, they appear in search. The site is all hand coded and not using a CMS.
Technical SEO | | hfranz0 -
.htaccess when integrating one website into another
My client would like to integrate one of it's smaller websites into its main website. I've identified around 20 pages which I'd like to 301 redirect to specific pages on the main website, and this is simple enough. The problem I have is that I am not sure how I can then put a catch-all to redirect all other pages on the site to the homepage of the main website. I'd originally though something like this would work: redirect 301 / http://www.mainwebsite.com/ (catch-all)
Technical SEO | | AndrewAkesson
redirect 301 /about.asp http://www.mainwebsite.com/about (specific redirect 1)
redirect 301 /latest.asp http://www.mainwebsite.com/news (specific redirect 1)
etc. Any ideas?0 -
Mod Rewrite Help
I need some help with doing the Mod Rewrite on our htaccess file. Basically I've a URL like this : www.example.co.uk/new-toy-search?keys=xbox and I want to rewrite the URL into something else (such as new-toy-search-xbox.html) Could someone please take me through the steps of how to do this? I've had a look at the Apache site but it's really confusing the way it's explained!
Technical SEO | | DanHill0