just wondering how I add a trailing slash at the end of my URL's using Mod_Rewrite?
This is my .htaccess file currently:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]*)$ index.php?pageName=$1
My URL show like so:
wwww.****.com/pageName
I want it to show like so:
wwww.****.com/pageName/
The URL is holding a GET request internally, but I want it to look like a genuine directory.
Best Answer
First we need to have 'mod_rewrite' module enabled.
Then make sure your configuration file has
RewriteEngine on
before following rules are applied.
Here is rule that will check if REQUESTED
then
make external redirect (301) to your domain.tld/ with whatever was requested and / appended. Make this last rule of given set.
Next rule
Then pass through all requested as 'pageName' param to index.php / make this last rule and do query string append.