How do I use only one URL
-
my site can be reach by both www.site.com and site.com. How do I make it only use www?
-
Thanks so much for the information!
-
Yes, sorry did not see the second link, and yes some web servers notably windows iis shared servers are pretty tricky at setting up .htaccess. Both are valid solutions though, just depends on circumstances.
-
Glad I could help weblion,
Malcolm that is a 301 redirect using .htaccess that you have written - the second link on my response shows you the different ways to go about implementing a 301 redirect including your method, which I have personally used on sites.
Not all web servers are compatible with 301 redirects using .htaccess, so I would definitely look at the different options for which best fits in with your setup.
-
Matt is right, but you may also want to use a .htaccess solution. Add this or get your devs to add this to your .htaccess file
<code class="htaccess" title="in your .htaccess file">RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]</code>
If you use this method plus Matt's then you may find you end up with a redirect loop. I personally use the .htaccess rule, but each to their own.
-
Thank you so much! This is what I was looking for.
-
Setup a 301 redirect (permanent) from site.com to www.site.com. You might find this guide useful - http://www.seomoz.org/learn-seo/redirection
And this will show you all the different ways of creating a 301 redirect - http://www.webconfs.com/how-to-redirect-a-webpage.php
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
-
Google selecting incorrect URL as canonical: 'Duplicate, submitted URL not selected as canonical'
Hi there, A number of our URLs are being de-indexed by Google. When looking into this using Google Search Console the same message is appearing on multiple pages across our sites: 'Duplicate, submitted URL not selected as canonical' 'IndexingIndexing allowed? YesUser-declared canonical - https://www.mrisoftware.com/ie/products/real-estate-financial-software/Google-selected canonical - https://www.mrisoftware.com/uk/products/real-estate-financial-software/'Has anyone else experienced this problem?How can I get Google to select the correct, user-declared canoncial? Thanks.
Technical SEO | | nfrank0 -
Backlinks that go to a redirected URL
Hey guys, just wondering, my client has 3 websites, 2 of 3 will be closed down and the domains will be permanently redirected to the 1 primary domain - however they have some high quality backlinks pointing the domains that will be redirected. How does this effective SEO? Domain One (primary - getting redesign and rebuilt) - not many backlinks
Technical SEO | | thinkLukeSEO
Domain Two (will redirect to Domain One) - has quality backlinks
Domain Three (will redirect to Domain One) - has quality backlinks When the new website is launched on Domain One I will contact the backlink providers and request they update their URL - i assume that would be the best.0 -
I have one keyword which disappeared
My site currently ranks for over 2000 of which 92 are in the number 1 position. Im very active with this site. My Main keyword is a two word keyword ,I have never been below the position #30. Has always been at best 3rd and fourth page. I rank primarily for mostly 3 part keywords and 4 part keywords. However , I noticed about a month ago,The main keyword no longer showing up on serp tools .Moz included. At first i was getting wierd results using keyword tool .Not moz serp tool. I would get different result every time i checked it. When i tried to verify these results ,Only to find my site not at the projected page and rank. After more than a month now this particular keyword is no where in site. Im still getting traffic fom all the other keywords but im a bit confused over this. I thought my main keyword was about to be on the bottom of the 2nd page but instead seems to be completely gone.
Technical SEO | | Yellow20000 -
Google lists eBay.au number one for vertical garden and their sellers are using my IMAGES
Is there anyway of getting Google to slap eBay with a loss of page rank ? eBay.au has number one position for vertical garden in google.com.au. (search 9000). Fair enough I suppose because they are delivering a huge range of vertical garden products BUT the sellers are using images for their products that are not showing their products. Most of the sellers are flogging China copies - and I mean these are really bad copies. But what angers me even more is some of their top sellers are using MY IMAGES. They have taken my images used on a UK website and have reused them in AUstralia. Sellers have even rebranded my images. GRRRRR Is there some international sin bin where I can name and shame? Does Google care about such matters?
Technical SEO | | GardenBeet0 -
Spaces (actual spaces) in URL
Hi all, Is there a huge loss of SEO performance if a URL shows spaces with an actual space (i.e. %20) in the URL rather than a "-" (or indeed a "_")? I know the preferred option is to have a "-", but I am just wondering if it is worth our effort to manually change the "%20" to a "-" in all the instances? Thanks 🙂 Diana
Technical SEO | | Diana.varbanescu0 -
Keyword in URL vs organization
I have a jobs site that currently has the following structure for jobs: www.site.com/jobs/openings/1234.html Categories used to be listed this way: www.site.com/jobs/openings/accounting But we changed it to: www.site.com/jobs/category/accounting Does it matter? Is one better than the other? The page title, heading, and description also have the word "openings" or "opening" in them.
Technical SEO | | cmp1010 -
Negative url name?
I have a new client who has the letters "BB" at the start of his url name, bbzautorepair.com. He was told by someone at Google Adwords that the letters "BB" in his url name could hurt him with Google rankings. Reason being that Google red flags anything or website to do with firearms, guns and ammunition. He was told that the letters "BB" could be mistaken or red flagged for "BB Gun". Seems a bit far fetched. Has anyone every heard of such a thing? Thanks
Technical SEO | | fun52dig
Gary Downey0 -
Should Canonical URLs be used in Wordpress?
Wordpress offers Canonical URLs in the "All in one SEO" settings. I know that canonical tags for page content will cause the search engine to ignore the content, but I don't understand this setting in Wordpress. The Canonical URLs box for my blog had been checked until a couple weeks ago. I unchecked it (removing the canonical tag) and now I have about 300 duplicate content pages acccording to my SEOMoz reports. It appears that it's just the blog tag in the url now that is causing the confusion. Here's an example of the same url with two tags: http://www.rmtracking.com/blog/tag/aclu/ http://www.rmtracking.com/blog/tag/rfid/ Should I activate the canonical URL setting in Wordpress again. If not, how can I fix this? Your assistance is greatly appreciated. Regards, Brad
Technical SEO | | BradBorst0