我有网址:
http://localhost/project/home/index.php
我想在我的网址中删除/ home /。这该怎么做? 我的htaccess文件
RewriteEngine on
RewriteBase /project/
RewriteRule ^home/(.+)$ $1/index.php
答案 0 :(得分:1)
尝试
RewriteEngine on
RewriteBase /project/
RewriteRule ^index\.htm$ home/index\.htm
RewriteRule ^index\.php$ home/index\.php
这应该将您的site.com/index.html和index.php分别指向home / index.html和home / index.php
答案 1 :(得分:0)
这是你想要的吗?
RewriteEngine On
RewriteBase /
RewriteRule ^/project/home/(.+)$ $1