.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
-
Will properly encoded & signs hurt or help me?
Hello friends, Will properly encoding a url hurt my ranking after having it improperly coded? I want to change my & symbols to & If I go from:
Technical SEO | | sonic22
http://www.example.com/product.php?attachment=pins&model=cool To:
http://www.example.com/product.php?attachment=pins&model=cool Will I get hurt if I make the leap?0 -
I hope someone can help me with page indexing problem
I have a problem with all video pages on www.tadibrothers.com.
Technical SEO | | TadiBrothers
I can not understand why google do not index all the video pages?
I never blocked them with the robots.txt file, there are no noindex/nofollow tags on the pages. The only video page that I found in search results is the main video category page: https://www.tadibrothers.com/videos and 1 video page out of 150 videos: https://www.tadibrothers.com/video/front-side-rear-view-cameras-for-backup-camera-systems I hope someone can point me to the right way0 -
Joomla creating duplicate pages, then the duplicate page's canonical points to itself - help!
Using Joomla, every time I create an article a subsequent duplicate page is create, such as: /latest-news/218-image-stabilization-task-used-to-develop-robot-brain-interface and /component/content/article?id=218:image-stabilization-task-used-to-develop-robot-brain-interface The latter being the duplicate. This wouldn't be too much of a problem, but the canonical tag on the duplicate is pointing to itself.. creating mayhem in Moz and Webmaster tools. We have hundreds of duplicates across our website and I'm very concerned with the impact this is having on our SEO! I've tried plugins such as sh404SEF and Styleware extensions, however to no avail. Can anyone help or know of any plugins to fix the canonicals?
Technical SEO | | JamesPearce0 -
Trying to Optimize my site for one keyword any advice please
Hi, we are trying to optimize our site www.in2town.co.uk for the keyword of lifestyle magazine. We are having trouble with this. We were last year number one in google for the keyword and then the end of last year we went to position four and now we are on the bottom of the second page and we are not sure what is happening. here is the text view of the site http://webcache.googleusercontent.com/search?q=cache:5U281SBmDlUJ:www.in2town.co.uk/&hl=en&client=firefox-a&gl=uk&strip=1 I am just wondering if we need to do a better description of the lifestyle magazine at the top as i know it says you should have your keyword within the first 100 words Any help on trying to solve this problem and get the page back where it belongs will be great. I know we have a lot of text on the page so google maybe finding it hard to find out what keywords are what but the only keyword we are interested in this page is lifestyle magazine, in the near future we would be looking at including lifestyle news many thanks
Technical SEO | | ClaireH-1848860 -
Help! www and non-www urls are driving me mad!
Sorry folks, I'm a very recently joined member, and after a five year gap in creating websites, I've decided to get back into the saddle and start again. Boy how things have changed! I'm soaking up all sorts of information from everywhere I can to get up to date with these changes, but I've come across this www v non-www problem in a big way. I realise there are already posts in here about this, but each time I read them, my mind seems to slip into some sort of loop that does not get anywhere. Basically, I think Google has indexed most of my pages as non-www, and only a hadful as www's. I have opened two accounts in Google Webmaster Tools for both www and non-www, and declared my preference for both accordingly. That was two days ago. As unprofessional as it may sound, I use Serif Web Plus X6, simply beacause it did the job six years ago, and it's all I know until I find and teach myself something better. My question is this - I can only create one page on X6, and yet there are two versions indexed in Google (although not all of them). I can only amend the one page that exists in X6, so how do I canonicalize two pages when there's the only version I have access to amending? Or am I miissing the point??? I hope that made sense?! I wouldn't mind, but I specified that I didn't want the site to be indexed yet with 'no follow', as it's nowhere near finished, but for some reason (probably due to placing Adsense ads on there) Google went ahead and indexed it anyway! The site is either http://www.cushioncutengagementringsstore.com or http://cushioncutengagementringsstore.com, depending on how you look at it! Any light you can shed on this would be gratefuly received! Thanks. Cem.
Technical SEO | | ConwyWebDesign0 -
I need help with a PHP canonical URL tags
I found a little difficult for me to do a canonical tag in my PHP. On-Page Report Card We check to make sure that IF you use canonical URL tags, it points to the right page. If the canonical tag points to a different URL, engines will not count this page as the reference resource and thus, it won't have an opportunity to rank. If you've not made this page the rel=canonical target, change the reference to this URL. NOTE: For pages not employing canonical URL tags, this factor does not apply. I don't know how to tidy my PHP Any suggestion.
Technical SEO | | lnietob0 -
Need Help with MAGENTO - URL rewrite
Hello... Hopefully a Magento expert will stumble across this question and help me out. I have noticed that my site is no longer as prominent as it once was for specific product pages... I am looking for help in rewriting the URL's for the product pages. I want it to have xyz.com/product (which exists if you hard code it into the site) If you wind up on the product by clicking throught the categories the url looks like: xyz.com/category/subcategory/product. Does anyone know how to make it so when you land on a product page it is just xyz.com/product ? My Site is : http://goo.gl/JgK1e Thanks for the help...
Technical SEO | | Prime850 -
Joomla 1.7 sef404 advice please
Hi not sure if anyone uses joomla on here but if they do i would love there advice. I have just got a joomla site that is joomla 1.7 but i cannot find a sh404sef component to make the url friendly and would like to know if there is a component out there or if you can use an older one. I would have thought by now that they would have installed one with joomla 1.7 If anyone uses joomla, then i would be glad to hear from you.
Technical SEO | | ClaireH-1848860