Apache .htaccess重写高级规则
我想要一个.htaccess重写规则,但我想不出怎么做 例子 www.example.com/index.php=>www.example.com/index.php www.example.com/folder/profile.php=>www.example.com/profile.php www.example.com/folder=>www.example.com 一种重写规则,可以在顶层为特定文件夹中的文件提供服务,同时仍为顶层文件提供服务。给你!试试这个 编辑:对exclude index.php进行了更改Apache .htaccess重写高级规则,apache,.htaccess,Apache,.htaccess,我想要一个.htaccess重写规则,但我想不出怎么做 例子 www.example.com/index.php=>www.example.com/index.php www.example.com/folder/profile.php=>www.example.com/profile.php www.example.com/folder=>www.example.com 一种重写规则,可以在顶层为特定文件夹中的文件提供服务,同时仍为顶层文件提供服务。给你!试试这个 编辑:对exclude in
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/folder/
RewriteRule ^(.*)$ folder/$1 [L]
我对我的Zend Framework项目也这样做,我将所有请求从我的路由到以重定向,如果文件不存在,请执行此操作
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /folder/$1 [R]
是否要在此处生成example.com/index.php am异常?很抱歉,虽然我看到了你的问题,但我认为你的答案有错::PI做了更改,你现在可以试试吗?你是否包含了一个标志,我建议从[R]开始