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
-
Which one is better?
I am working on creating new blog. I already had one. I want to add this new topics as subdomain. Now i am confused. Which one will be better for SEO? subdomain.maysite.com or mysite.com/subdomain Thanks in advance
Technical SEO | | Beachflower0 -
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 -
Best practice for multiple domain links
A site i'm working on has about 12 language domains - .es, it, .de etc. On each page of every domain the header has links to every homepage. At the moment these are all set to no-follow as an initial step to stop potential link profile issues spreading around. Moving forward i'm not totally sure how to handle these links. On one side I see and agree that no-follow is not necessary, but do-follow is just filtering out and weakening link juice. What is the best way to handle this scenario?
Technical SEO | | MickEdwards0 -
Making one landing page rank higher than another
I have a website which uses an individual landing pages to greet traffic for each suburb in our service area. For a long time we had one landing page which covered a region of suburbs but we've since added individual pages for those suburbs as well. However, Google will always display results for the old regional page, even though the new pages are optimized for searches in that area. Is there anything I can do to get Google to display the pages I want?
Technical SEO | | mark.schad0 -
My Old Domain is Not Changing in Google
I have taken over the following domain www.choice-cottages.co.uk, part of the contract was to re-direct the old site www.choicecottages.info to the new site. Unfortunately I am only a middle man in the arrangement as the website is hosted with another company. The switch was done well over 4 weeks ago, the re-direct itself is working fine. However if you google choice cottages you will see the first listing is www.choicecottages.info, then I have my new site below for a few listings. Google is definitely updating something as before the old domain had lots of site links but this has reduced to a few. Does anyone know anything on this, as in the past it only takes a couple of days to update. Many thanks Andy
Technical SEO | | iprosoftware0 -
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 -
Block a sub-domain from being indexed
This is a pretty quick and simple (i'm hoping) question. What is the best way to completely block a sub domain from getting indexed from all search engines? One item i cannot use is the meta "no follow" tag. Thanks! - Kyle
Technical SEO | | kchandler0 -
Subfolder to Root Domain, Should i or not?
Dear All, I am kinda of stuck and need your helps, I have major client's site which is located in subdirectory. Instance: http://www.majorclient.com.cn/cn/ and as you can see domain name is already localized and they are not planning to make any english version of the site, So there will be no /eng/ folder but clients whole website is /cn/ subdirectory which is totally unnecessary and i would like to 301 whole site to **http://www.majorclient.com.cn ** But the problem is that this site has been /cn/ folder forever since the beginning and lot of trusted links are pointing to www.majorclient.com.cn/cn/ So should i move it or just configure 301 www.majorclient.com.cn to www.majorclient.com.cn/cn/ leave it there and don't bother. Help?
Technical SEO | | DigitalJungle0