Question

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 ?

Était-ce utile?

La solution

Put this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteCond %{REQUEST_URI} !\.html$ [NC]
RewriteRule ^(.+?)/?$ /$1.html [L,R]
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top