Frage

I'm working with html5 pushState(), but if i wanna load the site by a pushState URL it returns 404.

Therefore i need to rewrite all /somePushStateURL to /somePushStateURL.html to get to the right site.

How the right htaccess entry will look like ? Are there some other solutions for my problem ?

War es hilfreich?

Lösung

Put this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteCond %{REQUEST_URI} !\.html$ [NC]
RewriteRule ^(.+?)/?$ /$1.html [L,R]
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top