Add a trailing slash mod_rewrite

Posted by Conner Stephen McCabe on Server Fault See other posts from Server Fault or by Conner Stephen McCabe
Published on 2012-10-04T08:56:01Z Indexed on 2012/10/04 9:39 UTC
Read the original article Hit count: 272

Filed under:
|
|
|

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.

© Server Fault or respective owner

Related posts about linux

Related posts about apache2