Canonicalization issue I cant work out
-
Seo Moz have kindly brought to my attention some canonicalization issues with my site.
Firstly I've adjust http://capitalalist.com to 301 redirect to http://www.capitalalist.com via htaccess.
But the crawl has shown for every page in my site the problem below:
http://www.capitalalist.com/cirque-du-soir
http://www.capitalalist.com/cirque-du-soir/
It's just that last / that's causing the problem. But I can't seem to see anyone having the same issue before.
BTW im using wordpress if that makes a difference.
Can anyone elaborate on the issue? How would i adjust my htaccess file to redirect a request with a / on the end of it?
Thanks in advance!
-
Thanks Jassy.
Exactly what i was looking for.
Good stuff!
-
Hi Paul, try something like this, but there are many variations of these on the web.
Posted this just as the yoast post was coming on.
#add trailing slash
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)([^/])$ http://www.capitalist.com/$1$2/ [R=301,L]add www for non www pages
RewriteCond %{HTTP_HOST} ^capitalist.com$ [NC]
RewriteRule ^(.*)$ http://www.capitalist.com/$1 [L,R=301] -
The good folks at Yoast created a Wordpress plugin to deal with this very issue:
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
-
Index Bloat: Canonicalize, Redirect or Delete URLs?
I was doing some simple on-page recommendations for a client and realized that they have a bit of a website bloat problem. They are an ecommerce shoe store and for one product, there could be 10+ URLs. For example, this is what ONE product looks like: example.com/products/shoename-color1 example.com/products/shoename-color2 example.com/collections/style/products/shoename-color1 example.com/collections/style/products/shoename-color2 example.com/collections/adifferentstyle/products/shoename-color1 example.com/collections/adifferentstyle/products/shoename-color2 example.com/collections/shop-latest-styles/products/shoename-color1 example.com/collections/shop-latest-styles/products/shoename-color2 example.com/collections/all/products/shoename-color1 example.com/collections/all/products/shoename-color2 ...and so on... all for the same shoe. They have about 20-30 shoes altogether, and some come in 4-5 colors. This has caused some major bloat on their site and I assume some confusion for the search engine. That said, I'm trying to figure out what the best way to tackle this is from an SEO perspective. Here's where I've gotten to so far: Is it better to canonicalize all URLs, referencing back to one "main" one, delete all bloat pages re-link everything to the main one(s), or 301 redirect the bloat URLs back to the "main" one(s)? Or is there another option that I haven't considered? Thanks!
Intermediate & Advanced SEO | | AJTSEO0 -
301 Question - issue
A while back we had a 'bleed' on one of our sites, which basically meant one of our sites started to leak across pages to another and that site started to rank for the same pages and now we have hundreds of pages ranking for urls that do not exists. It's hard to explain, bare with me. If you were to click on the cached view in Google for the ranked page it would show you the main site, but if you were to click it as usual, then you would be taken to the site but a 404 would show as the intended page was not for that site. We believe we fixed the 'bleed' and have setup 301s for all the affected pages to go to the home page for the site it affected. But these pages have not been removed from Google, which we thought a 301 would do. So we still have hundreds of pages being ranked but are redirected to the home page. Why hasn't these pages been removed?
Intermediate & Advanced SEO | | JH_OffLimits0 -
Redirect Issue in .htaccess
Hi, I'm stumped on this, so I'm hoping someone can help. I have a Wordpress site that I migrated to https about a year ago. Shortly after I added some code to my .htaccess file. My intention was to force https and www to all pages. I did see a moderate decline in rankings around the same time, so I feel the code may be wrong. Also, when I run the domain through Open Site Explorer all of the internal links are showing 301 redirects. The code I'm using is below. Thank you in advance for your help! Redirect HTTP to HTTPS RewriteEngine On ensure www. RewriteCond %{HTTP_HOST} !^www. [NC]
Intermediate & Advanced SEO | | JohnWeb12
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] ensure https RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] BEGIN WordPress <ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</ifmodule> END WordPress USER IP BANNING <limit get="" post="">order allow,deny
deny from 213.238.175.29
deny from 66.249.69.54
allow from all</limit> #Enable gzip compression
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript #Setting heading expires
<ifmodule mod_expires.c="">ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/x-ico "access plus 1 year"
ExpiresByType image/jpg "access plus 14 days"
ExpiresByType image/jpeg "access plus 14 days"
ExpiresByType image/gif "access plus 14 days"
ExpiresByType image/png "access plus 14 days"
ExpiresByType text/css "access plus 14 days"</ifmodule>0 -
Issues with Sitelinks
Hey Everyone, I found a couple threads where this was asked, but unfortunately I haven't seen any responses that explain it yet. My issue is with the sitelinks Google is choosing for a section of my website; they're using wrong/lowercase anchor text for a couple of the page titles that isn't anywhere on the page or in the backend that I can find (see screenshot). Any thoughts/reasons as to why they'd be using the lowercase text there? Thanks in advance! David 9r9Pz4w
Intermediate & Advanced SEO | | davidkaralisjr0 -
Will authorship for a reviewer, not an author work?
I'm working with a client that owns a medical site. All content is reviewed by someone from their medical board (doctors or nurses), but the content is written by a variety of authors. I'm wondering if we could create authorship profiles for the doctors and nurses. Would there be any problem with that? (even though they didn't write the content, they just reviewed it for medical accuracy). The name of the reviewer is included on every article. Any thoughts / feedback / similar experiences would be helpful.
Intermediate & Advanced SEO | | nicole.healthline0 -
Google Cache Redirection Issue? Or awaiting DNS Propagation?
We have just launched an Australian version of our .com site. The domain example.com.au used to redirect automatically to example.com. We updated the DNS to point to our new Australian site on 13 August and have started a two week soft launch to iron out issues and allow us to start the indexing process. The issue is, when I'm checking to see if we have been crawled yet, if I do I search for: cache:http://www.example.com.au The cache automatically redirects to http://www.example.com and shows the cache for that site. The date on the cache is: 14 Aug 2012 20:47:34 GMT. My question is, have I missed something during this process or are we just waiting for the DNS change to fully propagate?
Intermediate & Advanced SEO | | Benj250 -
Strategy for a large website where you only work for one business unit.
I have been tasked with improving traffic/leads to www.intertek.com. The problems we face are that I only work for one of the business units. There are many within the company and they all work independantly. The services my division offers range from ISO certification to food safety/testing to oil and gas services. They want to increase their quality content and traffic. What is the best strategy to approach working with a company this diverse and the limitation of managing 500 pages of a 15,000 page site? What are the first steps and what actions do you think would give the best results?
Intermediate & Advanced SEO | | laura-intertek0 -
Any Case Study of Reversion of Canonicalization?
Hi, Understand that if a Page A is being canonicalized to Page B, most probably Page B's ranking will increase (given their content and structure are all the same). But when the canonical tags are removed from Page B, Page A's rankings and traffic may recover to the original before it was canonicalized. The theories seem very true but does anyone have any case studies or direct experiences which proves these theories? Thanks.
Intermediate & Advanced SEO | | globalsources.com0