DDMSEO - Full Stack Developer based in London

Optimize your website SEO with X-RAY SEO Auditor

Published: 8th Mar 2018 | Words: 160 | Reading Time: 1 minutes

Categories / Tags:

Development
htaccess

URLs with trailing slashes can create a second variation of a page and lead to duplicate content issues across your website. For SEO reasons you should redirect your URLs to one variation, either one with a trailing slash on all URL's or one without. Using .htaccess regex rules its fairly easy to accomplish. Personally I think you should redirect to the non trailing slash across your website. One is it makes your URLs shorter, and two because it covers multiple trailing slashes which can happen in some instances. ////// to /

RewriteBase /
RewriteRule ^(.*)/$ https://ddmseo.com/$1 [R=301,L]

The rule above is quite straight forward and should be placed in your .htaccess. It takes everything before the / in the current page path (.*) and appends it after the protocol and host on the right hand side $1.

It uses a 301 permanent redirect which should be used for these types of redirects.

Rate this article

Average: 0.00 out of 5 / Votes: 0

Comments

Please login or register to post comments

Login | Register