What is the correct htaccess code for Canonicalization?
-
I've been working on a clients site and put up the following but when I check back on seomoz i have over 3000 errors and notices and its been crawling a silly amount of pages that don't exist!!
ErrorDocument 404 /404.html
Options +FollowSymLinksDirectoryIndex index.html RewriteEngine OnRewriteBase / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index.html\ HTTP/ RewriteRule ^index.html$ http://hiperformanceautocentres.co.uk/ [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L]
-
It would be a good starting place for sites that are created in a similar way.
-
Should this basically be the htaccess starting point for every website that I create going forward?
-
Thats great thanks for that Chris.
-
This basically says change anything ending index.html to end / using a 301 redirect
<code>RewriteCond %{THE_REQUEST} ^.*\/index\.html?\ HTTP/</code>
<code>RewriteRule ^(.*)index.html?$ "/$1" [R=301,L]</code>
This says redirect anything that starts http://www.domain...... to just http://domain......
<code>RewriteCond %{HTTP_HOST} ^hiperformanceautocentres.co.uk [NC]``` RewriteRule ^(.*)$ http://www.hiperformanceautocentres.co.uk/$1 [L,R=301] ```</code>
-
Okay then you want
ErrorDocument 404 /404.html
Options +FollowSymLinksDirectoryIndex index.html
<code>RewriteEngine on</code>
<code>RewriteCond %{THE_REQUEST} ^.*/index.html?\ HTTP/</code>
<code>RewriteRule ^(.*)index\.html?$ "/$1" [R=301,L]</code>
<code>RewriteCond %{HTTP_HOST} ^hiperformanceautocentres.co.uk [NC]```
RewriteRule ^(.*)$ http://www.hiperformanceautocentres.co.uk/$1 [L,R=301] -
oops - guess i've knackered this page with that code!!
Could you explain what all the code means in detail? I just copied and pasted the original!!
-
-
You haven't redirected www and non www so you need to add:
RewriteCond %{HTTP_HOST} ^hiperformanceautocentres.co.uk [NC] RewriteRule ^(.*)$ http://www.hiperformanceautocentres.co.uk/$1 [L,R=301]
What other errors are you getting? 3000 seems a lot!
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
-
Find 28 pages (status code 200) on MOZ Pro but 8 on Screaming Frog SEO Spider 11.3
Hi, Does anybody have an idea about this please? I am a newbie, so I am must be doing something wrong. The website: vtcservice-plus.com Thanks
Moz Pro | | ethan30000 -
302 Status Code for .com but 200 Status Code for .com/
I ran a moz crawl report for one of my sites. For mywebsite.com I'm getting a 302 HTTP Status Code but for mywebsite.com/ I'm getting a 200 HTTP Status Code. mywebsite.com -Title tag "blank" - Meta Description "blank" - HTTP Status Code "302" - Referrer "blank" - Content Type Header "blank" - 301/302 target "/" - Rel-Canonical Target "blank" mywebsite.com/ - Title tag "correct tag" - Meta Description "correct tag" - HTTP Status Code "200" - Referrer "mysite.com" - Content Type Header "text/html" - 301/302 target "blank" - Rel-Canonical Target "mysite.com/" Will this cause any issues with the search engines? Is there a way to fix this? I'm on wordpress and use Yoast SEO premium plugin. I have sites ranking in many different niches and have done similar white hat SEO for all of my others. They are ranking in competitive niches but for some reason this site is in the 200-300s for basically all keywords in not a very competitive niche. It has excellent content, links and no penalties. I'm trying to find anything that could be the cause of this. Thanks! <colgroup><col width="64"></colgroup>
Moz Pro | | cccreationsinc
| Rel-Canonical Target |0 -
Is my 404 page set up correctly?
HI there! In using a few different tools, and I have received varied result concerning my 404 page. In WebSite Auditor from Link Assistant, it says my page is set up incorrectly. My webmaster has told me that it is set up correctly, but at this point I'm not entirely sure what's what. Is there another way to test it? I guess i'm not quite sure about the jargon and what "return 404 response code" actually means. Thanks for your help!
Moz Pro | | NutcrackerBalletGifts0 -
Errors in my coding how significant is this regarding rankings ?
I posted a question on here yesterday about the homepage asking for advice regarding the content and then was told by two people were very helpful bbut moved over comment not on content but to say taht the major problem was that the coding on my website basically has too many errors which would result in me receiving lower rankings in the search engines. I realise this website is old-fashioned Dreamweaver template which was constructed several years ago which I've updated and I'm certainly not a professional, but I watch my Google analytics and there doesn't seem to be any significant change in the stats from this time last year. This is the site http://www.endeavourcottage.co.uk/ I realise the site is old format and has been around for several years it's just from customer feedback they seem to think it looks okay for the products old cottages but I guess technically it's not the best now. I have run a test using Silktide Nibbler - a free online service that gives you a good complete overview of your website with an overall score. And it did give my website an overall good score but did point out errors in the coding but when I checked some of my competitors near the top of Google for the short tail keywords some of them also have errors in their coding, very similar to my own error score.. I then went to Google Webmaster tools and there were no warning messages. So the big question is how important are these errors scores when it appears that most of the top competition also are in the same situation? I think it's quite possible I could do with a redesign using responsive design Best Alan
Moz Pro | | WhitbyHolidayCottages0 -
Duplicate Content, Canonicalization may not work in our scenario.
I'm new to SEO (so please excuse the lack of terminology), and will be taking over our companies inbound marketing completely, I previously just did data analysis and managed our PPC campaigns within Google and Bing/Yahoo, now I get all three, Yipee! But I digress. Before I get started here, I did read: http://moz.com/community/q/new-client-wants-to-keep-duplicate-content-targeting-different-cities?sort=most_helpful and I found both the answers there to be helpful, but indirect for my scenario. I'm conducting our companies first real SEO audit (thanks MOZ for the guide there), and duplicate content is going to be our number one problem to tackle. Our companies website was designed back in 2009, with the file structure /city-name/product-name. The problem with this is, we are open in over 50 cities now (and headed to 100 fast), and we are starting to amass duplicate content. Five products (and expanding), times the locations... you get it. My Question(s): How should I deal with this? The pages are almost identical, except listing the different information for each product depending upon it's location. However, for one of our products, Moz's own tools (PRO) did not find all the duplicate content, but did find some (I'm assuming it's because the pages have different course options and the address for the course is different, boils down to a different address on the very bottom of the body and different course options on the right sidebar). The other four products duplicate content were found and marked extensively. If I choose to use Canonicalization to link all the pages to one main page, I believe that would pass all the link juice to that one page, but we would no longer show in a Google search for the other cities, ex: washington DC example product name. Correct me if I'm wrong here. **Should I worry about the product who's duplicate content only was marked four times out of fifty cities? **I feel as if this question answers itself, but I still would like to have someone who knows more than me shed some light on this issue. The other four products are not going to be an issue as they are only offered online, but still follow the same file structure with /online in place of /city-name. These will be Canonicalized together under the /online location. One last thing I will mention here, having the city name in the url gives us a nice advantage (I think) when people are searching for products in cities we offer our product. (correct me again) If this is not the case, I believe I could talk our team into restructuring the files (if you think that's our best option). Some things you need to know about our site: We use a cookie for the location. Once you land on a page that has a location tied to it, the cookie is updated and saved. If the location does not exist, then you are redirected to a page to chose a location. I'm pretty sure this can cause some SEO issues too, but once again not sure. I know this is a wall of text, but I cannot tell you enough how appreciative I am in advance for your informative answers. Thanks a million, Trenton
Moz Pro | | PM_Academy0 -
Warnings, Notices, and Errors- don't know how to correct these
I have been watching my Notices, Warnings and Errors increase since I added a blog to our WordPress site. Is this effecting our SEO? We now have the following: 2 4XX errors. 1 is for a page that we changed the title and nav for in mid March. And one for a page we removed. The nav on the site is working as far as I can see. This seems like a cache issue, but who knows? 20 warnings for “missing meta description tag”. These are all blog archive and author pages. Some have resulted from pagination and are “Part 2, Part 3, Part 4” etc. Others are the first page for authors. And there is one called “new page” that I can’t locate in our Pages admin and have no idea what it is. 5 warnings for “title element too long”. These are also archive pages that have the blog name and so are pages I can’t access through the admin to control page title plus “part 2’s and so on. 71 Notices for “Rel Cononical”. The rel cononicals are all being generated automatically and are for pages of all sorts. Some are for a content pages within the site, a bunch are blog posts, and archive pages for date, blog category and pagination archive pages 6 are 301’s. These are split between blog pagination, author and a couple of site content pages- contact and portfolio. Can’t imagine why these are here. 8 meta-robot nofollow. These are blog articles but only some of the posts. Don’t know why we are generating this for some and not all. And half of them are for the exact same page so there are really only 4 originals on this list. The others are dupes. 8 Blocked my meta-robots. And are also for the same 4 blog posts but duplicated twice each. We use All in One SEO. There is an option to use noindex for archives, categories that I do not have enabled. And also to autogenerate descriptions which I do not have enabled. I wasn’t concerned about these at first, but I read these (below) questions yesterday, and think I'd better do something as these are mounting up. I’m wondering if I should be asking our team for some code changes but not sure what exactly would be best. http://www.seomoz.org/q/pages-i-dont-want-customers-to-see http://www.robotstxt.org/meta.html Our site is http://www.fateyes.com Thanks so much for any assistance on this!
Moz Pro | | gfiedel0 -
Keyword Difficulty Tool Full Reports - Are they correct?
Hello SEOMOZ Community I hope you can answer my following question. I’ve used the Keyword Difficulty and SERPS to analyse why my competitors seem to be higher than me in the SERPS for a certain keyword. The only problem I can see when I’ve done the full report is that our website has no internal links to the page we are trying to rank for, however when I go into Google webmasters tools it’s stating we have over 99,000 links. Can you please let me know why this is showing in the report? Many Thanks Matt
Moz Pro | | Steve250 -
SEOmoz not displaying correct amount of links?
When I go to the link analysis page where ti shows how many links my site has and how many my competitors have...it shows that I have 0 links. But Google Webmaster Tools shows my site as having 149 links. Is this a glitch with zeomoz or whats going on? The reason I initially subscribed to seomoz was to track my links. Thanks
Moz Pro | | tarik30010