.htaccess help please
-
Hi there,
Can anyone let me know what I need to add to my .htaccess file to make sure that the trailing slash on my domain gets redirected to my main domain name.
For example, at the moment Google is seeing my primary domain as follows:
I thought I'd covered off all possible duplication penalities but it look as though I've still got one left!
Thanks very much for your help,
Simon
-
If it's just the home-page, it might be easier safer to put a canonical tag on it. A canonical on the home-page can help sweep up weird variants (which are coming). If you got the htaccess route, just test it thoroughly. It can be really tough to write rewrites for other people's sites (without knowing specifics or testing). That said, I think @webfeatseo is on the right track.
-
I think this will remove
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC]
RewriteRule ^(.+)/$ http://www.domain.com/$1 [R=301,L]
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
-
Authority site drastic ranking drop after google https switch. Please Help!
Hi Mozers. Since Google switched to the https version, our company website (http://we.register.it) indexing switched to the https version (https://www.register.it). After that the ranking on Google dropped for almost every keyword. The site is very old and got a great authority and PR 7. It ranked for same keywords for very long time On each page from years there is the correct meta rel canonical. No spam, and WMT is ok. Could you please help? The internal links are all in http, and in https. If you are https are in https (they are all relatives) No changes have been made and the subdomain is in that way from 8 years: the main url has always been http://we.register.it Google started this indexing switch around the 15 October
Technical SEO | | luca_cash0 -
OMG!! 1300 404 Errors. HELP ME!!!
Day by day google detecting 404 errors urls. Currently it is cross 1340 urls. Please help me to get out of this shit. You can check the screenshot here You can see the screenshot here- http://img856.imageshack.us/img856/429/954b503e0781462c8a15774.png Please check the website - www.plugnbuy.com Kindly help me. I use nofollow tag but still don't know why google detecting those errors.
Technical SEO | | chandubaba1 -
Help! Same page with multiple urls. How is this handled?
I'm using DotNetNuke for many of our sites. DotNetNuke's home page can have multiple VALID URLs that go to the same home page. Example: http://aviation-sms.com http://www.aviation-sms.com http://aviation-sms.com/default.aspx http://www.aviation-sms.com/default.aspx and http://aviation-sms.com/aviationSMS.aspx http://www.aviation-sms.com/aviationSMS.aspx All the above URLs have the same content. In the page header tag, I have: Should I be doing something else? such as removing the "default.aspx"??? I have a blog also that has a boatload of pages. I tried this canonical approach, but I'm not sure SEO Moz likes it and the tool offers me little guidance on this issue.
Technical SEO | | manintights280 -
Over 700+ duplicate content pages -- help!
I just signed up for SEO Moz pro for my site. The initial report came back with over 700+ duplicate content pages. My problem is that while I can see why some of the content is duplicated on some of the pages I have no idea why it's coming back as duplicated. Is there a tutorial for a novie on how to read the duplicate content report and what steps to take? It's an e-commerce website and there is some repetitive content on all the product pages like our "satisfaction guaranteed" text and the fabric material... and not much other text. There's not a unique product description because an image speaks for itself. Could this be causing the problem? I have lots of URLs with over 50+ duplicates. Thx for any help.
Technical SEO | | Santaur0 -
Pointing a sub-domain to a sub-folder in htaccess
I have a client who currently uses shopify for there blog. I want to set them up with a separate blog away from the shopify system and host it in Australia. I know the best option is using a subfolder but as the shopify system is an unmoveable CMS can I somehow point my subdomain to a subfolder and get the benefits of the domain name? I could do this by using the rewrite rule in the htaccess file. If I was to do this would it end up cloaking the URL's of the articles?
Technical SEO | | acs1110 -
My pages says it has 16 errors, need help
My pages says it has 16 errors, and all of them are due to duplicate content. How do I fix this? I believe its only due to my meta tag description.
Technical SEO | | gaji0 -
Do links transfer after a 301? Please advise.
We own 2 websites. Website "A" has 100 external followed links pointing to it. I put a 301 on that domain and pointed it to Website "B". Shouldn't Website "B" now get credit for the followed links originally pointing to Website "A"? I'm hoping my external followed link count for Website "B" increases. Please advise... Thanks in advance!
Technical SEO | | WhiteCap0 -
.htaccess and www - non www
Recently I have taken over a website and I made a pretty colossal mistake. The site was properly constructed via .htaccess to a www domain. Typically I roll without it and I made a bad assumption that the .htaccess was not previously set correctly because there were hundreds of fundamental mistakes. After a couple of days I noticed the mistake but some of our new (non www) have picked up some solid links etc. So now I feel that I am in a nightmare of creating redirects etc. So should I switch back to WWW or not? Does it matter at this point?
Technical SEO | | mikeusry0