Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 从url中删除app/webroot_Php_Apache_.htaccess_Cakephp_Mod Rewrite - Fatal编程技术网

Php 从url中删除app/webroot

Php 从url中删除app/webroot,php,apache,.htaccess,cakephp,mod-rewrite,Php,Apache,.htaccess,Cakephp,Mod Rewrite,我正在尝试使用htaccess从CakePHP应用程序的url中删除app/webroot。我们知道只需将vhost指向app/webroot文件夹就可以修复它,但是出于某些原因,这里的开发人员更喜欢使用htaccess来修复它 任何人都知道或者这是可能的?设置您的各种.htaccess,如下所示: .htaccess在文档\u根目录中: .htaccess在文档\u根目录/应用程序中 .htaccess在文档_ROOT/app/webroot中 按如下方式设置各种.htaccess: .hta

我正在尝试使用htaccess从CakePHP应用程序的url中删除app/webroot。我们知道只需将vhost指向app/webroot文件夹就可以修复它,但是出于某些原因,这里的开发人员更喜欢使用htaccess来修复它

任何人都知道或者这是可能的?

设置您的各种.htaccess,如下所示:

.htaccess在文档\u根目录中:

.htaccess在文档\u根目录/应用程序中

.htaccess在文档_ROOT/app/webroot中

按如下方式设置各种.htaccess:

.htaccess在文档\u根目录中:

.htaccess在文档\u根目录/应用程序中

.htaccess在文档_ROOT/app/webroot中


提供一些您想要拥有的URI示例,了解您的努力也会很好。我想更改以提供一些您想要拥有的URI示例,同时了解您的努力也会很好。我想更改为
RewriteEngine on
RewriteBase /
RewriteRule (.*) app/webroot/$1 [L]
RewriteEngine on
RewriteBase /app/
RewriteRule (.*) webroot/$1 [L]
RewriteEngine On
RewriteBase /app/webroot/

RewriteCond %{THE_REQUEST} \s/+app/webroot/([^\s&]*) [NC]
RewriteRule ^ /%1 [R=302,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]