I have the following rewrite rules:
RewriteCond %{HTTP_HOST} ^www.website.co.uk$ [NC]
RewriteRule ^(.*)$ http://local.website.co.uk/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^.?\ ]+)\.php
RewriteRule ^([^.]+)\.php(/.+)?$ /$1%{PATH_INFO} [R=301]
I want to add a rule that removes the trailing slash if someone is trying to access the site using.
eg,
website.co.uk/cheese/ should redirect to / cheese
as you can see, I have a rule that redirects ursl with the .php extension, not sure where to start.
I have a directory in the root folder that I do not want to delete the trailing url, but I can add an ignore rule for them.
Greetings
source
share