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
-
Domain forwarding or redirects for SEO?
Hi all! A client of mine owns several top level domains which are not in use, let's call them example.nu, example.de, example.net and so on. The current website is example.com.
Technical SEO | | JHultqvist
When checking the technical status of the unused domains I realized that all but one are forwarded (via DNS) to example.com and only one has a 301 redirect. Should I redirect all of them by means of 301 or let them stay forwarded? Very few of the domains have any other sites linking to them. Any thoughts would be really appreciated! Jesper0 -
Spam flags for sub-domain
Hi Moz Community, I am reviewing our website via MOZ and found the following issues: http://shopwindowcleaningresource.com/ 1. No Contact (please refer to the attached image). However, we have an up to date contact info on our website. We have social buttons at the footer, our telephone number is at the top and we have a contact us page. Any idea, why we are being rated as such and how to resolve it? Any help will be greatly appreciated, thanks in advance. 327M9Fc
Technical SEO | | Shop-Sq0 -
Blog.domain or domain.com/blog
My client can't do domain.com/blog because he's on wix. I'm thinking blog.domain.com. Do you have any resources for the pros and cons of this? I understand that google looks at them very similarly now, is that true for google +?
Technical SEO | | tylerfraser0 -
Old domain vs. New keyword domain - Thoughts?
Okay. I'd like to get opinions as to what everyone thinks about domains lately. Here is any example: The current domain is general in nature, in fact, it's a persons name because they are a real estate agent. So the domain is something like JohnDoe.com. Current stats: Has approx. 130 linking domains pointing to it. Has over 300 incoming links from these linking domains. The link profile is clean and not spammy (not to say there are not a few that might be here and there) Was bough in 1994 The new domain would have very little value except it would be keyword rich such as PortlandHomesForSale.com (just an example). What are your thoughts. Thank you.
Technical SEO | | JordanRussell0 -
Mobile Domain Setup
Hi, If I want to serve a subset of pages on my mobile set from my desktop site or the content is significantly different, i.e. it is not one to one or pages are a summarised version of the desktop, should I use m.site.com or is it still better to use site.com? Many thanks any help appreciated.
Technical SEO | | MarkChambers0 -
IPs and Domains
If a domain loads on the domain and the IP is that a problem? So it loads on domain.com and 69.16.....com Thanks!
Technical SEO | | tylerfraser0 -
Lots of Domains Going Nowhere - Point to a Real Domain?
I have hundreds of domains that I have purchased over the years that arent going anywhere except GoDaddy's Cash Parking system, which returns very little revenue, if at all. I wonder if it would make more sense to just point these domains to actually e-commerce sites that I own. If so, how best to take these domains and point them so that SEO credit is given properly. Most of these available domains dont have anything to do with the e-commerce stores. So not sure it would help. Furthermore, if I were to purchase new domains that were more relevant to the keywords to our e-commerce sites, how best to set them up so we can generate traffic on them and point them over to the actual domains? Many thanks.
Technical SEO | | findachristianjob0 -
How does robots.txt affect aliased domains?
Several of my sites are aliased (hosted in subdirectories off the root domain on a single hosting account, but visible at www.theSubDirectorySite.com) Not ideal, I know, but that's a different issue. I want to block bots from viewing those files that are accessible in subdirectories on the main hosting account, www.RootDomain.com/SubDirectorySite/, and force the bots to look at www.SubDirectorySite.com instead. I utilized the canonical meta tag to point bots away from the sub directory site, but I am wondering what will happen if I use robots.txt to block those files from within the root domain. Will the bots, specifically Google bot, still index the site at its own URL, www.AnotherSite.com even if I've blocked that directory with Disallow: /AnotherSite/ ? THANK YOU!!!
Technical SEO | | michaelj_me0