Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/249.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 Silex和htaccess/web_Php_.htaccess_Symfony_Silex - Fatal编程技术网

Php Silex和htaccess/web

Php Silex和htaccess/web,php,.htaccess,symfony,silex,Php,.htaccess,Symfony,Silex,实际上,我正在使用Silex创建一个简单的应用程序,我遇到了一些问题 实际上,我运行在Apache2服务器上,在应用程序根目录下的ht访问中设置了fallback/index.php 事实上,我必须得到这些路线: 我需要像这样的东西 我完全不知道如何继续 你能帮我一点忙吗?修改你的.htaccess以更改你的根目录并替换index.php RewriteEngine On RewriteBase /appname/web RewriteCond %{REQUEST_FILENAME} !-f

实际上,我正在使用Silex创建一个简单的应用程序,我遇到了一些问题

实际上,我运行在Apache2服务器上,在应用程序根目录下的ht访问中设置了fallback/index.php

事实上,我必须得到这些路线:

我需要像这样的东西

我完全不知道如何继续


你能帮我一点忙吗?

修改你的
.htaccess
以更改你的根目录并替换index.php

RewriteEngine On
RewriteBase /appname/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ %2index.php [QSA]

这种基本用法总是出现在文档中。只需确保使用RewriteBase/appname/WebName。此外,如果您将应用程序代码保存在appname中,那么这是一种非常糟糕的做法,您的webroot应该是web文件夹(并且只能公开访问)。