I’m currently developing a site, and have the following RewriteRule in the site root:
RewriteRule ^loader$ loader.html [L]
So /site/loader will give the loader instead of /site/loader.html.
The strange thing is that Chrome won’t load any external content (css, js, images etc) when using the shorter URL. It works fine if you append the .html. It works fine in FF and IE too, so I doubt it’s a server configuration error.
In the Chrome developer console there are a lot of errors along the lines of:
(red cross) GET http://localhost/site/cs_inc/someResource.js
If I access that URL directly (or if the .html is appended to the initial URL) everything works fine.
Does anyone know how I can fix this?
edit: on request, the entire .htaccess file. Nothing really interesting though.
RewriteEngine on
RewriteRule ^function$ function.php [L]
# hide the .html
RewriteRule ^main$ main.html [L]
RewriteRule ^loader$ loader.html [L]
Options +Indexes
AddDefaultCharset utf-8
# Manifest file
AddType text/cache-manifest .manifest
# Don't cache it. Ever.
<Files offline.manifest>
ExpiresActive On
ExpiresDefault "access"
</Files>
It was a bit stupid: one of the tags had a type=”text/javascript” instead of “text/css”. Chrome ignored the error if there was a .html extention but it made it flip totally if the .html was ommited…