gpt4 book ai didi

javascript - 如何从 URL 中删除项目名称

转载 作者:行者123 更新时间:2023-11-28 06:10:47 25 4
gpt4 key购买 nike

我使用$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

现在我想从上面的网址中删除test。我怎样才能做到这一点???

enter image description here

最佳答案

首先从您的文件夹中删除托管提供商的 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]

关于javascript - 如何从 URL 中删除项目名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36417877/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com