我使用$locationProvider.html5Mode(true)从url中删除了散列标签
然后,我尝试使用htcaccess文件中的以下代码来解决刷新问题
Options +FollowSymlinks
RewriteEngine On
RewriteBase /test/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(css|js|html|png|jpg|jpeg|gif|txt)
RewriteRule (.*) index.html [L]现在,url看起来像
http://diafriends.hostoi.com/test/
http://diafriends.hostoi.com/test/about
http://diafriends.hostoi.com/test/contact现在,我想从上面的url中删除test。我该怎么做?

发布于 2016-04-05 14:03:23
首先,从您的文件夹中删除主机提供商的default.php文件,然后将以下内容添加到htaccess:
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(css|js|html|png|jpg|jpeg|gif|txt)
RewriteRule (.*) /test/index.html [L]https://stackoverflow.com/questions/36417877
复制相似问题