Doing some work on my site this past week, I found a little issue where if someone goes to site.com/page/ it returns a 404 error. However, if they go to site.com/page the correct page is shown.
Here's what I have for rewriting URLs:
- Code: Select all
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule . index.php [L]
It's working just as expected for sending everything through the index.php file if it's not an existing file or directory, but I'm wondering, is there a way that if the file isn't a directory, take off the trailing slash and send it through index.php as if it were site.com/page? I'm able to do what I'm looking for through PHP without a problem, but generally I like to keep all of my URL rules in the htaccess file.
Thanks much in advance!