我在角度项目工作。我正在使用角度ui路由。链接是http://keraiz.com。我需要从网址中删除#。所以我通过
启用html5模式$locationProvider.html5Mode(true);
我通过<base href = '/' />
定义基础href
然后我在.htassess文件中写入重写规则 -
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^(/index\.php|/img|/js|/css|/robots\.txt|/favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ./index.html [L]
现在在同一个标签上它运行正常。但如果我在新标签中重新加载链接或打开行,则跳转到404页面。那么我该如何解决这个问题呢。我不想去404页面。如果有keraiz.com/about的请求那么我想去页面