【发布时间】:2016-07-24 21:26:21
【问题描述】:
我使用$locationProvider.html5Mode(true)从网址中删除了哈希标签
然后我尝试在我的 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]
现在网址看起来像
http://diafriends.hostoi.com/test/
http://diafriends.hostoi.com/test/about
http://diafriends.hostoi.com/test/contact
现在我想从上面的 url 中删除 test。我该怎么做???
【问题讨论】:
-
尝试删除
RewriteBase -
@Rayon Dabre 我试过了。它不工作。
-
您需要使用根文件夹中的 htaccess 而不是测试。
-
@Rayon Dabre 我试过了。那也行不通。
-
@starkeen 我只将 htcaccess 文件放在根目录下。检查上面的屏幕截图。
标签: javascript jquery angularjs html .htaccess