Trailing Slashes In Url use Canonical Url or 301 Redirect?
-
I was thinking of using 301 redirects for trailing slahes to no trailing slashes for my urls.
EG: www.url.com/page1/ 301 redirect to www.url.com/page1
Already got a redirect for non-www to www already.
Just wondering in my case would it be best to continue using htacces for the trailing slash redirect or just go with Canonical URLs?
-
You are absolutely correct Kevin. By deciding to use a specific URL format on your site and consistently using the same format in all internal links you have done everything in your control. The overwhelming majority of the external links to your site will be correct.
Additionally, the links which use the wrong format will then be 301'd to their correct format rather then offering a 404 error. Only a very small percentage of links should require redirection and those that do will get it.
-
Hey Ryan,
Question here, but first the lead in. As you know, 301 redirects don't pass on 100% of link juice. I've set up my site to redirect all non-ww to www and all URLs to include a trailing slash. So now what happens to ranking when sites that link to my site don't include either the www or the trailing slash, which is actually quite common? Of course, asking the site owner to correct the link is ideal, but that's not always possible. So if thousands of links on external sites are linking to http://www.site.com instead of http://www.site.com/, won't lots of link juice get Lost in Redirection?
Kevin
-
Well never hurts to do both, thanks will look into runing both cononical and 301's
-
That's up to you, but I prefer to use both. The 301 redirect, once set up, should always work. At times a site experiences an issue whereby a .htaccess file is deleted, overwritten or modified accidentally. When that happens the issue may not be immediately discovered. Lots of headaches can be caused this way.
The canonical tag helps minimize the damage in this case, and also helps with the natural variations websites have such as a "print" version of a page.
-
Thanks Ryan, I suppose I'll leave out the Conanical tags
-
In my experience a 301 redirect is always the superior course of action. One reason is with a 301 redirect, you will ensure those who create links to your site will use the proper URL format. This way, your links go directly to the proper page without losing any link juice to a redirect.
Canonical tags are a great backup in case something goes wrong, but 301 redirects are always preferable.
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
-
In writing the url, it is better to use the language used by the people of my country or English?
We speak Persian and all people search in Persian on Google. But I read in some sources that the url should be in English. Please tell me which language to use for url writing?
Technical SEO | | ghesta
For example, I brought down two models: 1fb0e134-10dc-4737-904f-bfdf07143a98-image.png https://ghesta.ir/blog/how-to-become-rich/
2)https://ghesta.ir/blog/چگونه-پولدار-شویم/0 -
Missing 301 redirects
I just had a developer friend call me in a panic, because they had gone live with a new site and found out (the hard way) that they had missed some pages on their 301 redirects. So the pages are appearing in Google but serving 404s. Ouch! So their question was: other than running a report for 404 errors in something like Screaming Frog, is there a way to hunt down ONLY pages serving 404s, then export to CSV so they can be redirected? Anyone got any tricks up their sleeve?
Technical SEO | | muzzmoz0 -
Redirecting Canonical Hostnames
Hi, I want to rewrite all the url pages of "site.com" to "www.site.com". I read the moz redirection article and i concluded that this would be the best approach. RewriteCond %{HTTP_HOST} !^www.seomoz.org [NC]
Technical SEO | | bigrat95
RewriteRule (.*) http://www.seomoz.org/$1 [L,R=301]. But i recieved this error: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. I tried this rewrite too... RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301] It worked but it just rewriting my domain** "site.com"** and not all the subs "site.com/fr/example.php" to "www.site.com" Why it doesn't work properly, it seem to be easy... Could it be a hosting problem? Is there another way to do it? <address> </address> <address> </address> <address> </address> <address> </address>0 -
Best Place to Redirect 301 to?
Hey Everyone! I have an old site with hundreds of blog posts that are very spammy (duplicate content, keyword stuffed, and just plain bad content). I am going to redirect them and delete them from WordPress but I'm wondering where is the best place to redirect them to? Home page, other posts, other pages...? Any thoughts would be appreciated! Thanks!
Technical SEO | | adamxj21 -
What are the SEO implications of URLs that use a # in them?
I have several clients who have begun to ask questions about sites that are designed to look like a single page. When you click on a link, the URL changes but it uses a # before (i.e. http://www.kelloggs.com/teamusa**/#**/teamusa/athletes/kerri-walsh.html. What are the SEO implications of having a page set up this way? I noticed that Google has indexed this page but the indexed URL does not include a #. Is Google indexing a separate version of this page? Any insights would be really helpful! Thanks
Technical SEO | | VMLYRDiscoverability0 -
301 Redirecting weird URLs with % in them
I've been working on redirecting links reported as 404 in Google webmaster tools. I've stumbled upon 41 URLs that Google is reporting as 404 that include a '%' in the URL, but I don't know how to redirect. Here is an example: URL: bond_information.htm%20Surety%20Bond%20Information,%20with%20FAQ Attempted redirect: redirect 301 /bond_information.htm%20Surety%20Bond%20Information,%20with%20FAQ http://www.mysite.com/ Unfortunately, after implementing the redirect, http://www.mysite.com/bond_information.htm%20Surety%20Bond%20Information,%20with%20FAQ still resolves a 404 error. Anyone successfully fix these errors using Apache .htaccess?
Technical SEO | | TheDude0 -
Web config redirects not working where a trailing slash is involved
I'm having real trouble with getting working redirects in place to use on a site we're re-launching with a modified url structure. Old URL: http://www.example.com/example_folder/ New URL: http://www.example.com/example-of-new-folder/ Now, where the old URL's have a trailing slash the web.config simply will not accept it. It says the URL can start with a slash, but not end with a slash. However, many of my URL's do end with a slash so I need a workaround. These are the rules I'm putting in place: <location path="example_folder/"></location> Thanks
Technical SEO | | AndrewAkesson0 -
Should Canonical URLs be used in Wordpress?
Wordpress offers Canonical URLs in the "All in one SEO" settings. I know that canonical tags for page content will cause the search engine to ignore the content, but I don't understand this setting in Wordpress. The Canonical URLs box for my blog had been checked until a couple weeks ago. I unchecked it (removing the canonical tag) and now I have about 300 duplicate content pages acccording to my SEOMoz reports. It appears that it's just the blog tag in the url now that is causing the confusion. Here's an example of the same url with two tags: http://www.rmtracking.com/blog/tag/aclu/ http://www.rmtracking.com/blog/tag/rfid/ Should I activate the canonical URL setting in Wordpress again. If not, how can I fix this? Your assistance is greatly appreciated. Regards, Brad
Technical SEO | | BradBorst0