[英]How to Remove Project name From Url
我使用$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]
現在網址看起來像
http://diafriends.hostoi.com/test/
http://diafriends.hostoi.com/test/about
http://diafriends.hostoi.com/test/contact
現在我想從上面的url中刪除test
。 我怎樣才能做到這一點???
首先從您的文件夾中刪除托管服務提供商的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]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.