I am using the following code in my htaccess file which is almost getting the effect I want (which is for directories to be mapped to my PHP script).
Options +FollowSymLinks
RewriteEngine On
RewriteRule (.*)/$ index.php?r=$1
This allows me to have URLs like example.com/dir/ to be mapped to example.com/index.php?r=dir
The problem is that if I don't fully qualify the URL with a trailing slash i.e. example.com/dir I just get a page not found error.
How can I change this behavior so that this works properly? Perhaps example.com/dir could redirect to example.com/dir/ in the same way that Apache would do that by default if dir was actually a dir?
Thanks!
Options +FollowSymLinks
RewriteEngine On
RewriteRule (.*)/$ index.php?r=$1
This allows me to have URLs like example.com/dir/ to be mapped to example.com/index.php?r=dir
The problem is that if I don't fully qualify the URL with a trailing slash i.e. example.com/dir I just get a page not found error.
How can I change this behavior so that this works properly? Perhaps example.com/dir could redirect to example.com/dir/ in the same way that Apache would do that by default if dir was actually a dir?
Thanks!