Hello,
This is my first post here, i've been trying for quite some considerable time to sort this problem. I've read a lot of articles and naviagted many tutorials all to no avail. I saw on google, quite a lot of threads relating to a similar problem so thought i'd ask for some help here as people seem to know what there talking about.
I have a site that i'm developing and i wanted to automatically append the trailing slash, as my current rules allow for them to be either a "www.example.co.uk/page" or "www.example.co.uk/page/".
I thought that it looked tidier with the slash.
My page structure isn't very complex either. I'm only passing at most one variable. They pages look like either:
www.example.co.uk/page
or
www.example.co.uk/page/someone
This is the set of rules I have made to accomplish losing the '.php' extension, but i'm really struggling getting the rules to add the slash and display the page properly. I mostly find that i can add the trailing slash but this then gives me a 404 error or the variables arent passed sadly.
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^page/?$ page.php
RewriteRule ^page/([A-Za-z\+\-]+)/?$ ./page.php?x=$1
Any help would be massively appreciated.
Thanks in advance
Max