What I want the address bar to show:
http://facebook.com/user
http://facebook.com/user/ -> http://facebook.com/user
http://facebook.com/user/photos -> http://facebook.com/user/photos
My rewrite rules:
RewriteEngine On
RewriteRule ^(.+)/$ $1 [NC]
RewriteRule ^([A-Za-z0-9_-]+)/?([A-Za-z0-9_-]*)$ user.php?id=$1&second=$2 [NC,L]
What happens:
1). http://domain.com/user (working well)
2). http://domain.com/user/ (keeps the / in the address bar and destroys css/js/img paths)
3). http://domain.com/user/photos (same result as 2, correct except the paths)
If I use <base href="...">
to force the paths the page displays correctly. But I want to solve my problem without it.
How can I remove the trailing slash in the address bar? The rewriting seem to be working like intended.