after doing tons of tests and looking a lot into stackoverflow, I can't figure out how to achieve this.
I have a website served in a subfolder (www.domain.com/subfolder/
). I have the .htaccess located in that subfolder (www.domain.com/subfolder/.htaccess
) and I have 3 htmls (index.html, example1.html, example2.html
)
I want when you access to www.domain.com/subfolder/example2.html
it opens www.domain.com/subfolder/example2/
with clean urls and with css, js and image paths working.
I don't know how to set this subfolder as root and continue working clean url's.
This is mi actual .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.html
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
I've tried several thing but seems nothing works.
Thanks in advance. Diego