的Symfony在督促ENV主页上1.4错误400(而不是在开发ENV)
问题描述:
我已经在我的电脑上进行测试的应用程序,所有工作正常(我只用通过frontend_dev.php页面的开发环境)。的Symfony在督促ENV主页上1.4错误400(而不是在开发ENV)
当我部署在测试服务器上这个应用程序,我有以下的错误400错误请求:
坏请求
您的浏览器发送的请求,该服务器无法理解。
我访问与正常网址的网站。 我使用symfony 1.4的教条(没有涉及其他插件),wamp 2(php 5.3,apache 2.0.59)。
如果我尝试与开发环境来访问应用程序,它的工作原理。
答
尝试检查,如果no_script
财产上的应用程序setting.yml
文件。如果要设置为False,清除缓存,再次尝试
答
非常感谢您Guiman。你已经把我引向了答案。
的no_script_name
财产不是问题的根源。相反,我的网页目录中有我的.htaccess
这是很糟糕的生成(我发誓在我的宠物的头上,我以前没有编辑过这个文件)。下面是symfony中产生的文件(加粗属性不是一个代码中工作,看看最后一行):
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
# uncomment the following line, if you are having trouble
# getting no_script_name to work
#RewriteBase/
# we skip all files with .something
#RewriteCond %{REQUEST_URI} \..+$
#RewriteCond %{REQUEST_URI} !\.html$
#RewriteRule .* - [L]
# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
,这是(再次,看看最后一行)更新之一:
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
# uncomment the following line, if you are having trouble
# getting no_script_name to work
#RewriteBase/
# we skip all files with .something
#RewriteCond %{REQUEST_URI} \..+$
#RewriteCond %{REQUEST_URI} !\.html$
#RewriteRule .* - [L]
# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ **/myApp/index.php** [QSA,L]
</IfModule>
我不知道发生了什么,但我会检查symfony网站,我也有类似的问题。
那么这将是我的第二种方法:P,知道你可以自己想象出来是很了不起的!欢呼声 – guiman 2012-02-08 13:26:55