使用htaccess从url中删除基本文件夹

时间:2014-03-05 17:37:02

标签: .htaccess url-rewriting clean-urls

我正在尝试重写

http://127.0.0.1:8888/folder/page/display-6.html

http://127.0.0.1:8888/page/display-6.html

htaccess文件位于目录

这是我的.htaccess文件:

Options +FollowSymLinks -MultiViews
RewriteEngine on

RewriteCond %{REQUEST_URI} folder/(.*)
RewriteRule ^(.*)$ / [L]

1 个答案:

答案 0 :(得分:0)

您可以使用此规则:

Options +FollowSymLinks -MultiViews
RewriteEngine on

RewriteCond %{THE_REQUEST} /folder/(\S+)
RewriteRule ^ /%1 [L,R]