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
-
Using images from one domain on another?
I run a travel photography business where I sell fine art prints. I've been toying with the idea of creating a few new websites about some of the places I've traveled to. This is for a few reasons. First, because I love talking about my travels. But second, because I feel like it might be a good way to bring in more print sales from those places. The question I have, if I were to use the images from my main photography sales domain on a different domain, how does this affect SEO? These images filenames for the photographs are already optimized well for searching. Thanks!
Technical SEO | | shannmg10 -
Moving wordpress from one domain to another and phpmyadmin
Hi all, I have moved a site made in wordpress from a domain (domain1.com) to a different one (domain2.com). I have created a new db and I have been forced to give to it a different name, because in my cpanel mysqldatabases you can create db using only a prefixed db name structure (such as namehosting_(empty field)). So from database nama namehosting1_wp, I have forced to create namehosting1_wp, changing parameters in wp_config.php I have also forced to change db user for the same reason. I have gone to phpmyadmin to import the sql database previously exported from domain2.com. It gives to me this message: #1044 - Access denied for user 'nameuser'@'localhost' to database 'information_schema'. It seems that I have not right privileges. Or should I follow some other procedures? Thanks and ciao Bob
Technical SEO | | bobrock40 -
More than one web domain
Hi What is best when considering using more than one domain on a website, what the best policy ? it's a question I get asked a lot, usually because prior to any seo efforts the main domain name purchased is not keyword rich or an abbreviated company name etc. what impact do new domains have on SEO compared to older existing domains- is it worth changing a generic company named domain for a keyword rich domain? if having multiple domains pointing to the site is beneficial how best is it to configure? How do i inform Google? How do both domains get index when there is only one physical site? How should i monitor it, Analytic s, SEO moz? Will the domain compete against each other and effect SEO rank? Are they best used for marketing purposes on external sites, adverts driving traffic to the main site. I'm aware there are lots of questions above, any answers/ opinions , links to further info would be greatly appreciated. cheers
Technical SEO | | Bristolweb0 -
Why is there duplicates of my domain
When viewing crawl diagnostics in SEOmoz I can see both "www.website.com" and a truncated version "website.com" is this normal and why is it showing (I do not have duplicates of my site on the server)? E.g.: http://www.klinehimalaya.com/
Technical SEO | | gorillakid
http://klinehimalaya.com/0 -
Multiple domains pointing to same site
Over the years, we have acquired a great number of variations of our domains, or industry-specific domains to protect our brand. Currently, the majority of those domains are parked at the registrars. Would we do any harm to our rankings if we pointed the dormant domains to our website (www.ellsworth.com)? If not, are there any recommendations as the best way to do this, or just point them to the same IP?
Technical SEO | | Ellsworth0 -
Hosting sitemap on another server
I was looking into XML sitemap generators and one that seems to be recommended quite a bit on the forums is the xml-sitemaps.com They have a few versions though. I'll need more than 500 pages indexed, so it is just a case of whether I go for their paid for version and install on our server or go for their pro-sitemaps.com offering. For the pro-sitemaps.com they say: "We host your sitemap files on our server and ping search engines automatically" My question is will this be less effective than my installing it on our server from an SEO perspective because it is no longer on our root domain?
Technical SEO | | design_man0 -
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 -
Are multiple links devalued on the same domain?
I'm in negotiations to get links placed on a popular blog with good stats. I'm allowed to pick older posts on the site, and I get to pick the anchor text. Is it best practice to diversify the links by having different keywords pointing to different pages or am I better off pointing as many links as I can at one page (varying anchor text)? Also, is it best to pick a more recent blog post, or is it ok to pick one from say, 2009?
Technical SEO | | MichaelWeisbaum0