I want to redirect all requests from root/test.php to root/pages/test
I already managed to eleminate the need for the .php extension by inserting ...
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
... into my htaccess.
But how can I additionally achieve that all pages are actually stored in /pages?
I tried to change RewriteRule ^(.*)$ $1.php to RewriteRule ^(.*)$ /pages/$1.php but that only works if I have a file with the same name in my webroot.
The reason for this is, that I dont want to have all my pages in the webroot folder since there are a lot of pages and I want to keep my root folder 'clean'.
Thx already!