I've tried some different solutions I've found on the web on my .htaccess file (placed in the root of my website), but I always end up with an "Internal Server Error"...
I need a generic rule to remove a specific folder from the URL and the extension of all the files contained in it (adding a trailing slash at the end), with a redirection to the rewrited url. So, for example:
the folder I want to work on is called "pages", so the rule should not affect any other folder, and I want that the url
http://www.example.com/subfolder/pages/
will be rewrited/redirected to
http://www.example.com/subfolder/
and
http://www.example.com/subfolder/pages/page1.php
will be rewrited/redirected to
http://www.example.com/subfolder/page1/
and
http://www.example.com/subfolder/pages/subpages/page1.php
will be rewrited/redirected to
http://www.example.com/subfolder/subpages/page1/
and so on...
How can I achieve that?