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
-
Ecommerce website - Transition from one subdomain to another. Please help!
Hi MOZers, I have an ecommerce website with its mobile version of the site sitting in a subdomain. It is going to be transferred to another subdomain on the same website. How do I ensure that I save/carry over most of the traffic, authority and equity to the new sudomain? At the moment, we are not looking to get rid of the subdomain but maybe later, yes. Malika
Technical SEO | | Malika10 -
Is there a way to tell which redirect - from another domain - is driving traffic to your website?
My company acquired another domain/website several year's ago. We want to see - for accounting purposes, how much traffic/revenue that site's REDIRECTS are driving to our website now. Is there any way to pull this information? I thought of comparing when the site was originally redirected to our traffic/revenue changes - but so much has changed from the acquisition that I wouldn't have faith in this value. Thanks for any assistance you can provide.
Technical SEO | | Blenny1 -
301 - Specific Domain
In Google our main website page url is <cite class="_Rm">www.wheelchairparts.com</cite> it has 25 root domain links & PA 34. When you go to our website from there, the homepage url is http://www.wheelchairparts.com/store/pc/home.asp it only has 3 root domain links & PA 27. Do I need to add a 301 Redirect here? What kind of redirect is on it now? Thanks, - Mike Bean
Technical SEO | | Mike.Bean0 -
.com domain is an iframe copy of a .net domain?
Hey folks, This one is over my head. I'm helping out a friend's dental office website (www.capitolperiodontal.com), and their home page source code points to the .net TLD for its content apparently: | | <title></span>http://www.capitolperiodontal.com/</title> http-equiv="content-type" content="text/html" /> rows="100%" id="dd_frameset_0001"> src="http://www.capitolperiodontal.net/" name="dd_content_0001" framespacing="0" frameborder="0" noresize="noresize" title="capitolperiodontal.com" /> <noframes></noframes> My idea was to load all the content from the .net to the .com, then redirect the .net to the .com as it has better domain authority and is, well a .com. Any insights what this iframe biz is all about and if my strategy above is ok? Many thanks folks! john
Technical SEO | | juanzo0070 -
How to properly abandon mod rewrite?
Hi, We've done mod-rewrite to our .php files to show .htm files several years ago for SEO purposes. My question is, doing this has become a hassle for adding new pages, etc. and I'd like to make a clean break with the .htm and move to their real file names and or directories (e.g. company.htm --> /company/ ). What kind of ranking penalty am I looking at if we switch? We're a small company with billion dollar competitors so a rank loss would be fairly devastating. I assume I'd need to do 301 redirects for all of the old file names (obviously yes for the change from page to directories) but for each individual page? Thanks, Matt
Technical SEO | | mynewco0 -
Geolocation has changed targeted domains, or has it?
I am monitoring two domains; a .com and a .com.au in quite a competitive sector (men's underwear online sales) last month the .com site completely dropped from rankings sight in Google International SERPs but, the .com.au site is actually ranking (quite respectively too) in the International/US Google SERPs. I have no idea how, when or why but it's now been the case for two months. Help please?
Technical SEO | | Vovia0 -
New Sub-domains or New Directories for 10+ Year Domain?
We've got a one-page, 10+ year old domain that has a 65/100 domain authority that gets about 10k page views a day (I'm happy to share the URL but didn't know if that's permitted). The content changes daily (it's a daily bible verse) so most of this question is focused on domain authority, not the content. We're getting ready to provide translations of that daily content in 4 languages. Would it be better to create sub-domains for those translations (same content, different language) or sub-folders? Example: http://cn.example.com
Technical SEO | | ipllc
http://es.example.com
http://ru.example.com or http://example.com/cn
http://example.com/es
http://example.com/ru We're able to do either but want to pick the one that would give the translated version the most authority both now and moving forward. (We definitely don't want to penalize the root domain.) Thanks in advance for your input.0 -
Why Google did not index our domain?
Hi, We launched tmart 60 days ago and submitted to google, bing, yahoo 20 days later. But google had never indexed our website still when yahoo indexed it in one week. What we have checked or tried: 1. We got 20~50 inlinks in one month and now 81 inlinks via yahoo site explorer. 2. This domain has registered for 13 years and we purchased it from sedo last year. We
Technical SEO | | zt673
did not find any problems from domain archive pages. 3. Page similar: the homepage is 50% similar to one of our competitors when we just launched.
So we adjusted the page structure and modified the content one month later and decreased the similarity to 30% (by tools from webconfs.com) 4. Google Robots: googlebot crawled our website every day after we submitted for indexing.
We opened GWT account for it and added the xml sitemap last week. GWT said nothing
was wrong except the time of page loading. Our questions: Why google did not indexed our website? What should we do? Thanks, wu0