Forum Moderators: phranque
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
RewriteBase /
[edited by: engine at 11:29 am (utc) on Dec 16, 2011]
[edited by: g1smd at 8:24 pm (utc) on Dec 10, 2011]
I wont get into why exactly I need my url's like that, but the fact is I do need them that way. Any other way would be redundant.
[edited by: montesano at 10:29 pm (utc) on Dec 10, 2011]
After mods, the links I put 'out there' looked like:and would take a visitor to path:example.com/48YSWD96and would also force their url to/48YSWD96.php.example.com/48YSWD96/
example.com/48YSWD96 to example.com/48YSWD96/ and the latter request is then rewritten to /48YSWD96.php to serve the content. You should not have been linking to example.com/48YSWD96. If you want users to see and use a URL ending with a slash, like example.com/48YSWD96/ then that is the URL that you should have used in the links. URLs are defined by what you put in the href= part of a link. (www.)example.com/<stuff> and (www.)example.com/<stuff>/ to www.example.com/d=<stuff> (www.)example.com/<stuff>.php to www.example.com/d=<stuff> example.com/d=<stuff> to /stuff.php [edited by: g1smd at 10:46 pm (utc) on Dec 10, 2011]