Recently, one of our SEO Account Managers came across something interesting. He questioned why a page would throw up a “404 - Page Not Found” error if all that was missing at the end of the URL was a slash. An example is below:
http://www.example.co.uk/examples/
Without the / at the end of the URL, a 404 error appears. Our SEO guru wanted to know how to get around this.
So, after consulting our very technically minded Development department, a clear and concise answer was found. To get around this error, you can add a line to your .htaccess file which will rewrite all the URLs without slashes to then include one. Before, the URL on an apache webserver without the slash is assumed to be a page.
For webmasters out there, here is an essential bit of code to use to sort the problem out:
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*[^/])$ http://www.example.com/$1/ [R=301,L]
This will rectify the issue sitewide rather than see you having to go in and change each page individually.
Tagged with :