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
-
Multisite domain
good morning I have a wordpress site I have activated the multisite, currently the site has a domain authority of 8, when I publish a post, it is indexed quite quickly, if I publish a post in a language other than the /es subdomain it takes 24 hours why? If the author domain is the same, why does the employee take longer to be indexed on Google? Thank you
Technical SEO | | alainscilly770 -
301 domain name to another site
I had 2 websites. I decided not to maintain one of them and set it to 301 to my main website. However, i see people getting 404 errors when they land on my main website but with a page name from the old site. How can I set things so that anyone who tries to go to the old site goes to my homepage of my main site? http://siteA.com http://oldsiteB.com/oldpagename sends them to http://siteA.com//oldpagename = 404 - I want them to go directly to homepage on siteA.
Technical SEO | | bhsiao0 -
Several personal websites moving to one domain - 301 or 302?
I feel like I've thought about this so much that now I'm thinking in circles and can't figure this out, so I hope someone can help! We have a group of physicians who currently practice privately, but are going to become one entity with one website. However, they are going to look like sub-entities, if this makes sense - instead of every practice being "One Practice Medical Group" they'll be "Lakeside Primary Care - A One Practice Medical Group Company," and then the other guy will be "Red Mountain Primary Care - A One Practice Medical Group Company" and so on for about a half dozen practices. They all have personal sites already, and many are concerned that they will lose any history for their personal sites and will not rank as well in Google as they do right now. One doctor really wants to keep his own site, and then just have a link on his profile page of the new entity's website. Isn't this counterproductive? Also, if we do redirect all the personal websites to the new entity's domain, it will pass any page rank they already have, correct? Should these be 301 redirects, or 302 redirects? None of the current sites really have a lot of "link juice" but we're working with several strong personalities who want the benefits of the big entity but the autonomy of a private practice.
Technical SEO | | RachelEm0 -
Redirect to new domain
We are moving our website from http://mysyncpad.com to http://syncpadapp.com The old site ranks pretty well for some specific keywords, will a 301 allow the new site to rank as well or will it be penalized by good for the transfer?
Technical SEO | | fifthlayer0 -
Apache Rewrite Verse Redirect
I put in a request with my IT team to implement some 301 redirects. We recently launched a major redesign and there multiple version of some pages with different URLs. They asked why they could not do Apache Rewrites, so it was not necessary to return an HTTP header. I know Google's Webmasters best practices is to use 301 redirects. I am not familiar with the technical aspects of Apache et al. Are there advantages to using a rewrite? Thanks
Technical SEO | | SuperMikeLewis0 -
What is the advantage of using sub domains instead of pages on the root domain?
Have a look at this example http://bannerad.designcrowd.com/ For each category of design, they have a landing page on the sub domain. Wouldn't it be better to have them as part of the same domain? What is the strategy behind using sub domains?
Technical SEO | | designquotes0 -
To 301 redirect or not to 301 redirect? duplicate content problem www.domain.com and www.domain.com/en/
Hello, If your website is getting flagged for duplicate content from your main domain www.domain.com and your multilingual english domain www.domain.com/en/ is it wise to 301 redirect the english multilingual website to the main site? Please advise. We've recently installed the joomish component to one of our joomla websites in an effort to streamline a spanish translation of the website. The translation was a success and the new spanish webpages were indexed but unfortunately one of the web developers enabled the english part of the component and some english webpages were also indexed under the multilingual english domain www.domain.com/en/ and that flagged us for duplicate content. I added a 301 redirect to redirect all visitors from the www.domain/en/ webpages to the main www.domain.com/ webpages. But is that the proper way of handling this problem? Please advise.
Technical SEO | | Chris-CA0 -
Why the rapid drop in Domain Authority?
I couple weeks ago I switched my website from Drupal to a Wordpress CMS: Martial Arts Austin My rankings have remained the same, but the Domain Authority has plummeted from like 29 to 21. I know this is small fry, but I don't want my business to drop in ranking. The URL's were kept exactly the same, with the internal links and copy also kept the same with few additions. Also, according to Open Site Explorer, the site's stronger pages have now averaged out with the weaker and unused pages so they all now share the same Page Authority - that doesn't seem right. Is there reason for concern? Did I screw something up, or am I making too much of this? Thanks
Technical SEO | | OhYeahSteve1