Add .htaccess files to git
In order that URLs work without .html
extensions a .htaccess
file containing the following is needed in the DocumentRoot
as will as in sub-directories that contain .html
files:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteCond %{REQUEST_URI} ^(.+)\.html$
RewriteRule (.*)\.html$ /$1 [R=301,L]
The files exist on the live site -- I added them in the pub last night after we realised that all the pages apart from the front page were 404's...