Javascript 如何从Url中删除项目名称

Javascript 如何从Url中删除项目名称,javascript,jquery,angularjs,html,.htaccess,Javascript,Jquery,Angularjs,Html,.htaccess,我使用$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

我使用
$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]
现在url看起来像

http://diafriends.hostoi.com/test/
http://diafriends.hostoi.com/test/about
http://diafriends.hostoi.com/test/contact
现在我想从上面的url中删除
测试
。我该怎么做


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

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

尝试删除我尝试过的人造丝Dabre。它不起作用。你需要在根文件夹中使用htaccess而不是test。@Rayon Dabre我试过了。这也不起作用。@starkeen我只将htcaccess文件放在root中。检查上面的屏幕截图。尝试删除我尝试过的人造丝Dabre。它不起作用。你需要在根文件夹中使用htaccess而不是test。@Rayon Dabre我试过了。这也不起作用。@starkeen我只将htcaccess文件放在root中。检查上面的屏幕截图。