.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
-
Please help me figure out if my website is penalized? It is not in the search result page for the phrase that is original to it.
I just searched Google for the phrase that is original to my website (yourappliancerepairla.com😞 "LG actually has a very large and well respected home appliances business", and Google didn't bring my website at all. Does this mean that my website is penalized?
Technical SEO | | kirupa0 -
SEO Issues with Avactis Shopping Cart Please Help(Resolved)
I am seeking advise or help with several issues I am having with Avactis. First is Title Duplicates or adds the same on every CMS page Seal It Green Sealants - Non-Toxic Organic Sealant Products so for instance it say Contact Us-Seal It Green Sealants - Non-Toxic Organic Sealant Products or Whats the Difference Seal It or Xtreme -Seal It Green Sealants - Non-Toxic Organic Sealant Products every cms page it adds Seal It Green Sealants - Non-Toxic Organic Sealant Products to the title description. which in turn makes my Title Descriptions TOO LONG! Second is the very lengthy urls. I came into this project after the site was developed and there are more issues than I ever imagined. Duplicated Pages, Titles etc all over the place. Trying to work on one issue at a time. ( I think re-building the site using something else would of been a quicker solution) But Client didn't want to do that. Any advise or tips to get through this process with this platform would be extremely appreciated.
Technical SEO | | MACameron0 -
I always get this error "We have detected that the domain or subfolder does not respond to web requests." I don't know why. PLEASE help
subdomain www.nwexterminating.com subfolder www.nwexterminating.com/pest_control www.nwexterminating.com/termite_services www.nwexterminating.com/bed_bug_services
Technical SEO | | NWExterminating0 -
.htaccess and error 404
Hi, I permit to contact the community again because you have good and quick answer ! Yesterday, I lost the file .htaccess on my server. Right now, only the home page is working and the other pages give me this message : Not Found The requested URL /freshadmin/user/login/ was not found on this server Could you help me please? Thanks
Technical SEO | | Probikeshop0 -
Yoast WordPress SEO settings please help
Hello 🙂 Can you please look at these screenshots of my Yoast WordPress SEO settings http://www.zaslike.com/files/h5149mi5435dspiswfm.jpg http://www.zaslike.com/files/5dlhmjxfh2j0hqswesha.jpg http://www.zaslike.com/files/fmx1pwih240gwiofh86s.jpg http://www.zaslike.com/files/w7tyvlhgr5vhv149b9a.png http://www.zaslike.com/files/l9lo37jfpeqmrpufke8.png are they good ? Do i need to change something or correct ? please help Thank you !!!! :))))
Technical SEO | | wolfinjo0 -
Broken links shall i put them in my htaccess file to generate juice
Hi, when i had to rebuild my website after my hosting company made an error, i lost over 10,000 pages and lost many thousands of links coming to my site. What i want to know is, instead of trying to recreate those pages again which would take me a long time, should i put them into my htacess file and have them point back into my site. so for example, if i have a link coming to my site to an article which could be, holidays in benidorm are not selling well, would it be a good idea to have that link pointed at the main benidorm section which is benidorm news. And if i had an article which was people are finding it hard to lose weight, instead of writing a new article could i have the link pointing to my health section? If this is the correct way of doing it to grab back some link juice, would it slow my site down and how many links could i put in my htacess file. So what i am trying to say is, if i put in say 1000 redirects into my htaccess file, would it slow my site down and is this a wise thing to do or should i just let the links go.
Technical SEO | | ClaireH-1848860 -
Duplicate index.php/webpage pages on website. Help needed!
Hi Guys, Having a really frustrating problem with our website. It is a Joomla 1.7 site and we have some duplicate page issues. What is happening is that we have a webpage, lets say domain.com/webpage1 and then we also have domain.com/index.php/webpage1. Google is seeing these as duplicate pages and is causing me some real SEO problems. I have tried setting up a 301 redirect but it wn't let me redirect /index.php/webpage1 to /webpage1. Anyone have any ideas or plugins that can be used to sort this out? Any help will be really appreciated! Matt.
Technical SEO | | MatthewBarby0 -
Enable Keep-Alive your views please
Hi i am working on my site at the moment www.in2town.co.uk and i am going through y slow as well as http://gtmetrix.com/reports/www.in2town.co.uk/upnmEWvO to make my website faster and better and it is telling me to enable keep alive. Now i am not sure what this does but i have contacted my hosting company and they are asking me if there are any settings that i want. my site is in joomla and it is a magazine site, can anyone let me know if it is a good idea to enable this or not and if so what settings should i be looking at. my site is updated all day long so i need to make sure this is write for me. many thanks
Technical SEO | | ClaireH-1848860