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
-
Multiple sub domain appearing
Hi Everyone, Hope were well!. Have a strange one!!. New clients website http://www.allsee-tech.com. Just found out he is appearing for every subdomain possible. a.alsee-tech.com b.allsee-tech.com. I have requested htaccess as this is where I think the issue lies but he advises there isn't anything out of place there. Any ideas in case it isn't? Regards Neil
Technical SEO | | nezona0 -
Domain Authority why is change
Hey seomoz friends!
Technical SEO | | petrospan
I have a question and if you have some links to read about it, bring it on!! What variables changes that measurement?0 -
302 multiple domains...
Hello, I have a few domain names with orthographic variations that I'd like to redirect to my main site. The problem is my registrar (OVH) does only 302 redirects, so what are my options ? Can I keep a dozen 302's ? Do I have to change all their DNS (it's a load on my server...) ? Thanks for any ideas Johann.
Technical SEO | | JohannCR0 -
Domain taken. Which is better? Using hypens or longer domain.
I am wanting to set up an e commerce site and the domain name that I want is taken. I am considering using a domain that has the main keyword I want to rank for as the domain. I have heard chatter of google penalizing these types of sites and it seems that it hasn't come about. This is something that I would like to test out. So if "electricscooters.com" is taken, should I use "electric-scooters.com" or "electricscooters4less.com" Just wondering if the hyphenated or the longer domain will rank higher. The site won't be spammy at all, I will carry a few different companies that offer similar products. So for this case, I would only sell scooters from a few different manufacturers. Feedback would be appreciated!
Technical SEO | | Dave_Whitty0 -
Wildly different topics on one domain? (hobby blogger)
Hello Mozzers, Let's say I have a lot of knowledge about a range of different subjects, for example: bicycle maintenance wildlife photography tennis racket re-stringing brewing beer windsurfing holidays I would like to share all of my knowledge in blog format with lots of good content, instructions, videos etc. What is the best way to set up my blogging empire?!... a) Use separate domains for each subject: www.BRANDbicyclemaintenance.com, www.BRANDbrewingbeer.com b) Use one brand domain with sub directories: www.BRAND.com/bicycle-maintenance/, www.BRAND.com/brewing-beer/ b) Use sub-domains: bicyclemaintenance.BRAND.com, brewingbeer.BRAND.com (I would like to achieve good rankings & traffic in order to generate a small income from these sites)
Technical SEO | | Tman30 -
TLD domain rediversion
Hello, I have got a .co.uk version of my domain which is parked with godaddy and I want to divert it to the .com version which is the live site. At the moment the .co.uk version is showing a godaddy landing page. My setup is: Godaddy as domain registrar, domain.com host separate hosting company. I looked into godaddy panel and I guess I have two options. (which I have done as a quick fix), I have done the diversion within godaddy panel to the .com version. It simply asked for which domain I wanted to forward the .co.uk to, and I have entered the .com version. I can create the .co.uk domain within my shared hosting and repoint to the .com within the hosting company DNS settings, and have godaddy simply point to the hosting company nameservers instead. Are the two solutions above equivalent or is one better than others ? Esp. from an SEO point of view? If someone has technical expertise to explain, this would be great. I think it would also help other companies in the same situation. Thanks ! 🙂
Technical SEO | | dpaq20110 -
Migrating to a subdirectory in the same domain
Hi! I have a new version of my website, running with a different CMS (joomla). In order to install the new CMS while not loosing my all content and links I was forced to install the new site in a subdirectory. So the old website was http://www.mydomain.com And the new one is http://www.mydomain.com/subdirectory I had redirected http://www.mydomain.com to http://www.mydomain.com/subdirectory but I am not sure if that is correct, or if it will generate SEO problems. I named the subdirectory with a keyword, at least to have any advantage of something that to my short knowledge looks bad... What do you think? Another question... I understand that it is a good SEO rule to optimize each page for a different keyword. Is it a problem if http://www.mydomain.com is not optimized for anything? Thanks!
Technical SEO | | ociosu0 -
What to do with domain?
I bought a domain a couple months ago while having delusions of granger. The domain is PR2, has around 30 decent backlinks, and a small amount of traffic. It also has one of our keywords in the domain name. I'm thinking of 301 redirect to our homepage. Is there a downside to doing this? We really could use the additional traffic on our site.
Technical SEO | | dmac0