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
-
Are domain variations hurting our rank?
Hi, I have a client who registered many different variations of their domain name, that are pointing to the website. Now I see that many high value links are not linking to the main domain, but a hyphen variation. So when the main domain is something like www.brandservicename.com The links go to www.brand-service-name.com I suppose they should change all those links (if possible), but does it really make a difference? Thank you!
Technical SEO | | alism0 -
What is cross domain?
what is cross domain? can any one explain in simple language ?
Technical SEO | | constructionhelpline0 -
Domain Name Acquisition
Hi Anyone know how to get contact details for a domain owner beyond those provided by the likes of whois, archive etc etc ? Cheers Dan
Technical SEO | | Dan-Lawrence0 -
Buying Expired Domains
Recently i was looking to buy some good quality Expired Domains. But while performing site and links query on such domains in google, none of the domains are showing any links or pages indexed in Google but the same domains are showing hundreds of links in opensiteexplorer for that domains. So does Google has started devaluing expired domains or will expired domains recover all their rankings after re registration by us.
Technical SEO | | amit910 -
Domain with more Languages
Hey folks! I was wondering what you would do. I do have a Website. The website is provided in 8 other languages. Right now every language has it's own Domain name. The domain name is always the country in the language. I'm thinking about combine everything to one domain and hope to get some great linkjuice from the other 7 domains. So it would be www.example.com/en/ www.example.com/fr/ and so on. How do you handle that. Would this have a big positive impact on that one domain I'm forwarding to?
Technical SEO | | leitpix
I really think so!0 -
Referrals from widget domains
Let's say you are doing seo for a company that sells 5000 widgets. Let's call their site www.mainsite.com ... They have already set up ( purchased ) many domains such as www.widget1.com which is one of the widgets they have on their main site. so they might have several hundred of these domains. What is the best use of these domains? Would it be : Have those pages be landing pages with content and pictures and optimized with a link to their main site widget page? Or have that domain have a 301 redirect to go their main site, to the particular page showing that widget for sale off their main site? Miscellaneous sidebar question - Since both the main site widget page and the widget domain might be in competition and might have duplicate content, what are the ramifications of not using the canonical tag, and what other considerations might there be? How much must be duplicate content before considering using the canonical tag?
Technical SEO | | highersourcesites0 -
Redirecting one ecommerce site to another
Hi I'm planning to redirect one large ecommerce site to another. Here's how I was thinking of doing it: crawl both sites with Xenu and export urls to a CSV match urls where possible, redirecting pages from site A to relevant ones in site B all others will be redirected to site B's home page Now, I'm dealing with thousands of URLs here, so any way to make it easier would be great. Could this mean just redirecting all of Site A's pages to Site B's homepage would be worth it? Or does redirecting relevant pages where possible seem the best idea? Thanks guys!
Technical SEO | | neooptic0 -
If two links from one page link to another, how can I get the second link's anchor text to count?
I am working on an e-commerce site and on the category pages each of the product listings link to the product page twice. The first is an image link and then the second is the product name. I want to get the anchor text of the second link to count. If I no-follow the image link will that help at all? If not is there a way to do this?
Technical SEO | | JordanJudson0