简体   繁体   中英

How to Remove Project name From Url

I removed hash tag from url using $locationProvider.html5Mode(true)

and then i tried to resolve refresh problem using following code in my htcaccess file

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]

Now the url looks like

http://diafriends.hostoi.com/test/
http://diafriends.hostoi.com/test/about
http://diafriends.hostoi.com/test/contact

Now i want to remove the test from above url. how can i do that???

在此输入图像描述

First of all remove the default.php file of your hosting provider from your folder and then add the following to 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]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM