The best way to redirect to www
-
What is the best way to redirect non www to www. I saw a lot of the solution. is this one ok?
RewriteCond %{HTTP_HOST} !^www.seomoz.org [NC]
RewriteRule (.*) http://www.seomoz.org/$1 [L,R=301]
-
Glad you got it. The code I like to use:
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]Of course, replacing "domain" with your own domain.
Let us know if you need any more help.
-
yes, a lot of people don't know that you should verify both the www and non www version of your site in Google Webmaster Tools!
-
This works:
RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
and to select preferred domain name first I need to add non www version of the website and that's why I received an error.
You help me a lot!
-
What is the server error you are getting with the .htaccess file?
You do indeed need to verify ownership of you site, it's real easy to do, it involves adding a small piece of code to your site. See http://support.google.com/webmasters/bin/answer.py?hl=en&answer=35179 -
I got server error with .htaccess file and in webmaster tool message "Part of the process of setting a preferred domain is to verify that you own http://
-
That solution works just fine.
It looks like the one from the SEOmoz "Redirection SEO Best Practices"
I've never had any problems with it.
Also to keep things tidy, be sure to tell Google Webmaster Tools that your preferred domain is **www.**domain.com
GWMT -> configuration -> settings -> display URL's as www.domain.com
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
-
Press Page Best Practices?
Hey Mozzers! I have a question that I haven't found a perfect answer to yet. The company I work for has built a press/awards/news article page and I'm trying to determine the best format to showcase the information in. (You can take a look at the page here: https://www.webpt.com/about/press Should I have our team copy and paste the press releases onto our site and rel canonical that post to the original article? Or would it be better to just have a short intro paragraph and then have a read full story link at the bottom of that paragraph. Final question--should I make these pages noindex, nofollow? Looking forward to hearing everyone's answers!
On-Page Optimization | | WebPT0 -
Best SEO experts you know in India Chennai
Best SEO experts you know in India Chennai. Does anyone know of few companies who deal with SEO to help optimize keywords? and get more traffic for our website? thank you
On-Page Optimization | | bsharath0 -
301 twice redirect (no negative)
Can i made twice 301 redirect, because i got "droped" domain and i dont want negative effect to new website. Can i redirect users some other way with no negative effect for fresh website?
On-Page Optimization | | cerar0 -
Best practice for footer in ecommerce - Shall I add Top Category links?
What would you recommend regarding links to "Top Products" and "Top Categories" in footer? Would you add them to give extra link juice to top categories? would you try to avoid category links in footer that are already in the header navigationor in the main content area to avoid linking twice from all pages? would you vary these top category links in footer according to main category
On-Page Optimization | | lcourse0 -
What is the best way to manage industry required duplicate Important Safety Information (ISI) content on every page of a site?
Hello SEOmozzer! I have recently joined a large pharmaceutical marketing company as our head SEO guru, and I've encountered a duplicate content related issue here that I'd like some help on. Because there is so much red tape in the pharmaceutical industry, there are A LOT of limitations on website content, medication and drug claims, etc. Because of this, it is required to have Important Safety Information (ISI) clearly stated on every page of the client's website (including the homepage). The information is generally pretty lengthy, and in some cases is longer than the non-ISI content on each page. Here is an example: http://www.xifaxan.com/ All content under the ISI header is required on each page. My questions are: How will this duplicated content on each page affect our on-page optimization scores in the eyes of search engines? Is Google seeing this simply as duplicated content on every page, or are they "smart" enough to understand that because it is a drug website, this is industry standard (and required)? Aside from creating more meaty, non-ISI content for the site, are there any other suggestions you have for handling this potentially harmful SEO situation? And in case you were going to suggest it, we cannot simply have an image of the content, as it may not be visible by all internet users. We've already looked into that 😉 Thanks in advance! Dylan
On-Page Optimization | | MedThinkCommunications0 -
Tags or Categories: Which is best?
I seem to have duplicate issues on my website due to tags and categories having the same title. If I was to delete one of the two, which would be better to delete? Thanks!
On-Page Optimization | | IoanSaid0 -
Best URL Structure For Products That Are The Same
I know that the url structure is very important for seo preferably using the keyword. But is it okay to have the same url with the product number at the end ? Each of our products have a name with a product number. Or will this cause to many similar urls? or if the folder is the name of the product that needs to be optimized, can the page just be called the product number? Example: Say you have a 20 different product lines and they are all catagorized in the appropriate folders, and need to be optimized for the actual product name. XXX (folder name ) WWW-PR-123 WWW-PR-1234 WWW-PR-12345 WWW-PR-123456 what would be the best url structure? Can they have the same begining? The product name? something like: www.example.com/xxx/www-pr-123.php www.example.com/xxx/www-pr-1234.php or www.example.com/xxx/pr-123.php www.example.com/xxx/pr-1234.php
On-Page Optimization | | hfranz0 -
Best practice for franchise sites with duplicated content
I know that duplicated content is a touchy subject but I work with multiple franchise groups and each franchisee wants their own site, however, almost all of the sites use the same content. I want to make sure that Google sees each one of these sites as unique sites and does not penalize them for the following issues. All sites are hosted on the same server therefor the same IP address All sites use generally the same content across their product pages (which are very very important pages) *templated content approved by corporate Almost all sites have the same design (A few of the groups we work with have multiple design options) Any suggestions would be greatly appreciated. Thanks Again Aaron
On-Page Optimization | | Shipyard_Agency0