Currently the website’s files are located in the root folder with the following htaccess file
DirectoryIndex home.php
RewriteEngine on
## force www. ##
RewriteCond %{HTTP_HOST} !^www.truedesign.no$
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301]
## remove .php and re-direct any .php-addresses##
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\\ /([^.]+\\.)+php?\\ HTTP
RewriteRule (.+)\\.php?$ http://www.domain.com/$1 [R=301,L]
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME}\\.php -f
RewriteRule ^(.*)$ $1.php
We want to move all our website files to a certain folder on the webspace to keep the root folder more tidy. I normally would just do something like this:
redirect 301 /index.html http://www.domain.com/foldername/
This would give URLs like www.domain.com/foldername/ or www.domain.com/foldername/filename
Is ther any way to remove ‘foldername’ from the URL? We really just want www.domain.com/filename and www.domain.com for the home page (although these files would be located in a folder).
Many thanks.