I'm sure you've all seen sites with URLs like: http://www.mydomain.com/some_page.php/category1/page2
I was wondering if it was possible to have it but without the .php extension. I already have functions in my .htaccess file to hide .php extensions. It works perfectly everywhere, except when there is a trailing slash after it. How can I make it work? By the way, the 1/2/3/ is just a fancy Clean URLs-like way for me to pass in variables in a PHP file. I use the explode function to accomplis this in PHP, but anyway.
Here is the .htaccess code I've been using:
- Code: Select all
## Enable mod_rewrite, start rewrite engine
RewriteEngine on
RewriteBase /
## Converts test.php to test
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/?$ $1.php [L]
Please help, I've tried searching on this forum and googling like mad for several days and I came up with nothing. Thanks again!