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
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
-
What is the safest way to redirect for best SEO benefits?
What is the safest way to redirect for best SEO benefits? Example: loodgieter-aanhuis.nl -> loodgieters-ambacht.nl Does someone have any technical information on how to (root) redirect for best SEO practices?
On-Page Optimization | | hans-keeren0 -
Best site structure for us?
Hey guys, I have a somewhat silly question that I probably know the answer to - but would still like to hear your POV's. We're a WP theme making company but we also build other stuff. Context: 1. All demos for themes currently go under domain.com/Theme_A/ The demo is lorem ipsum so is marked noindex nofollow. That being said we get rocking analytics data usually (not sure if it's still valuable for G after the noindex). 2. Currently we need landing pages for themes and we're running them under domain.com/Theme_A/optimized-landing-page-title.php dofollow and indexed ofc. My question is...Would we be better off to include all landing pages under a domain.com/wordpress-themes/ category/tax and then go for the optimized-landing-page-title.php page? Does it make any difference either or? Right now we're not REALLY running them on subdomains (though the structure seems like it), they're just folders. We're thinking that more seo juice would flow through the different pages if we have them all under the same category, rather than basically starting from scratch each time under a new folder. Right? Thanks!!!
On-Page Optimization | | andy.bigbangthemes1 -
Auto loading articles ?- best practices
Hi all! In the past months I see more and more website that doing 'auto loading articles in scrolling' - can you tell me if it's okay for SEO and what are the best practices for this? Thanks!
On-Page Optimization | | JohnPalmer1 -
Best way to get the fastest WordPress site with existing template
I have a WordPress website that I started building for free and eventually paid the $50 bucks for the premium version. My goal right now is to increase the speed. The current speed rating for the site on Google Insights is 60/100 for mobile and 66/100 for desktop. I have used some plugins to help me increase the speed, but the previous number were the best I could do. How can I get this site at least into the 90/100 range? Should I buy another template, or can I hire someone to go through and optimize it. I would like the best option that is as cost effective as possible as this is a hobby site for me. Thanks!
On-Page Optimization | | FierceFrame1 -
301 Redirect to external site
Hi guys, We have a client who is getting their website redesigned through us. They are discontinuing couple of their services which will not get featured in the new site. They are fairly well ranked for these services and my client wishes to 301 redirect these pages to an external site owned by his friend so that they benefit out of the ranking. The question is: Will my client's website's general ranking get affected due to 301 redirecting to an external site? The external site is not spammy or red-flagged by Google (at the moment, at least). Thanks in advance!
On-Page Optimization | | RameshNair
Ramesh Nair0 -
URL best practices
Hi, I have a problem here, I used http://www.vietnamvisacorp.com/faqs.html instead of http://www.vietnamvisacorp.com/faqs. Hence, http://www.vietnamvisacorp.com/faqs will be caused 404 page. My question is should I change from faqs.html to faqs (no .html)? Thanks in advance any advice?
On-Page Optimization | | JohnHuynh0 -
What is the best setup for conical Links
Should I have the conical link state: 1. www.autoinsurancefremontca.com 2. www.autoinsurancefremontca.com/index.html 3. autoinsurancefremontca.com Also do you need a conical link on each page if you have more than one page on your site?
On-Page Optimization | | Greenpeak0 -
How to Define Best URL Structure for Product Pages?
I am working on my website to edit structure with help of Google's search engine optimization starter guide. There is really good instruction to define URL structure which help us to perform well over Google's organic search. I have resolved issues regarding category pages but, I have confusion to define best URL structure for product pages. My website's product page URL structure is as follow. http://www.vistastores.com/marketumbrellas-californiaumbrella-slpt758-f13-red.html http://www.vistastores.com/homefurniture-winsomewood-93630.html URL structure is constructed with following terms. 1. Root Category Name (Market Umbrellas or Home Furniture or ....) 2. Brand Name 3. Manufacturer Part Number I am not happy with this structure and also not performing well over Google's organic search. I am thinking to include product name or title tag in URL after root domain. But, it may create very long URL and create issues in organic search display. Does it really matter to perform well over Google's organic search? How can I define best URL structure for product pages?
On-Page Optimization | | CommercePundit0