I have a code here which rewrites url by adding trailing slash at the end. Condition:
- No File Extension
- No slash at the end
RewriteEngine On
RewriteCond %{REQUEST_URI} !\..*$
RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/Brian/$1$2/ [L,R=301]
If the url is:
http://localhost:8080/Brian/test123 -> http://localhost:8080/Brian/test123/ - CORRECT
http://localhost:8080/Brian/test123. -> http://localhost:8080/Brian/test123. - CORRECT
http://localhost:8080/Brian/test123.awd -> http://localhost:8080/Brian/test123.awd - CORRECT
http://localhost:8080/Brian/test123.awd/a -> http://localhost:8080/Brian/test123.awd/a - THIS IS MY PROBLEM
I want to make the result like this.
http://localhost:8080/Brian/test123.awd/a/
Please help. Thanks!