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 ?

有帮助吗?

解决方案

Put this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteCond %{REQUEST_URI} !\.html$ [NC]
RewriteRule ^(.+?)/?$ /$1.html [L,R]
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top