.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]
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
-
I'm struggling to understand (and fix) why I'm getting a 404 error. The URL includes this "%5Bnull%20id=43484%5D" but I cannot find that anywhere in the referring URL. Does anyone know why please? Thanks
Can you help with how to fix this 404 error please? It appears that I have a redirect from one page to the other, although the referring page URL works, but it appears to be linking to another URL with this code at the end of the the URL - %5Bnull%20id=43484%5D that I'm struggling to find and fix. Thanks
Technical SEO | | Nichole.wynter20200 -
Small blog needs paid SEO help
I looked at Moz's recommended companies but they are all for huge blogs and websites. I cannot afford those fees. My blog is small but growing and was hit by a Google Panda tweak back in July. My organic traffic disappeared overnight and although I've been working hard to improve my blog, I still get no organic traffic after being on the first page. I would like to pay someone to look at my site and give me help but I cannot pay what these huge companies are asking for. Any advice?
Technical SEO | | blogger20130 -
Can you help me understand leveraging semantic markup
Hi, i am trying to understand about leveraging semantic markup but even though i have read the page on the link, i am still not sure of what it means and how i can use it in my site www.in2town.co.uk which has been built using joomla If anyone can help me understand then that would be amazing and help me understand how it would benefit my site.
Technical SEO | | ClaireH-1848860 -
Creating in-text links with ' 'target=_blank' - helping/hurting SEO!?!
Good Morning Mozzers, I have a question regarding a new linking strategy I'm trying to implement at my organization. We publish 'digital news magazines' that oftentimes have in-text links that point to external sites. More recently, the editorial department and me (SEO) conferred on some ways to reduce our bounce rate and increase time on page. One of the suggestions I offered is to add the 'target=_blank" attribute to all the links so that site visitors don't necessarily have to leave the site in order to view the link. It has, however, come to my attention that this can have some very negative effects on my SEO program, most notably, (fake or inaccurate) time(s) on-page. Is this an advisable way to create in-text links? Are there any other negative effects that I can expect from implementing such a strategy?
Technical SEO | | NiallSmith0 -
Site Got Hacked! Need Help!
Hi Guys. One of my friend's site got hacked 2 weeks ago, because of bad php script hole and Google indexed the pages which got hacked and all the Title Tags and Descriptions are indexed in the Google which is very embarssing situation. All adult content texts. Right now we have solved the problem and closed the hole submitted the new sitemap, but Google is no longer coming back and refreshining the SERP. We have been waiting for 3 weeks for now? What should we do? Methods we tried so far: 1.Cleaned all meta tags generate new sitemap and submitted that to Google 2.Built some backlinks 3.Built some social bookmarks Thanks!
Technical SEO | | DigitalJungle0 -
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 -
Help changing category and page titles on established Magento site.
Hi All, This is my first post, I've been a Pro member for a while now, read many posts but have never asked a question here. I have an established Magento site that I need to do a lot of SEO work on. I am a newbie at SEO, so I wanted to ask for advice here. I just changed one of the category names, the url, meta title, and meta description. When making the change I selected the checkbox in the Magento backend that says "Create Permanent Redirect for Old URL" Example:
Technical SEO | | TrulyLuna
Old Category: http://www.domain.com/old-category-name.html
New Category: http://www.domain.com/new-category-name.html Everything worked fine with the exception of one alarming thing... I lost all of the page authority for the category itself and all of the sub categories and pages below it. Now the category and all pages below it show (on the moz toolbar) a PA of 1 and 0 links and 0 domains. I updated the sitemap. I did not do a 301 redirect in the .htaccess, I only chose the option to redirect on the Magento backend when changing the name and url of the category. I need to change a lot of other category and page names and urls but now I'm a bit gun shy, as I do not want to do something that will damage what little page rank I have at the moment. I'm looking for some advice from one of you guys who might be able to help me do this the correct way. I did some research on Google, but I'm still not sure of the correct method to accomplish this. Thanks in advance for any help that you can offer.0 -
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