dongqin5604
2016-02-26 09:47
浏览 40
已采纳

Symfony 2:Web服务器不会重写URL

when I put my web app (Symfony2) on production for this time the server doesn't rewrite (it often does) the URL and I don't know why. I usualuse the .htaccess files in the root and in the web folder.

.htaccess in root:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ web/$1 [QSA,L]

.htaccess in /web:

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ web/$1 [QSA,L]

the following error is generated by the server:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@subdomaine_goes_here.domaine_goes_here.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

图片转代码服务由CSDN问答提供 功能建议

当我将我的网络应用程序(Symfony2)投入生产时,服务器不会重写(通常会 )URL,我不知道为什么。 我通常使用根目录和web文件夹中的.htaccess文件。

根目录中的.htaccess:

 &lt; IfModule mod_rewrite。  c&gt; 
RewriteEngine On 
RewriteCond%{REQUEST_FILENAME}!-f 
RewriteRule ^(。*)$ web / $ 1 [QSA,L] 
   
 
 

/ n

.htaccess in / web:

RewriteEngine On RewriteCond%{REQUEST_FILENAME}!-f RewriteRule ^(。*)$ web / $ 1 [QSA,L]

服务器生成以下错误:

内部服务器错误

服务器遇到内部错误或配置错误,无法完成您的请求。

请通过webmaster@subdomaine_goes_here.domaine_goes_here.com与服务器管理员联系,告知他们这个时间 发生错误,以及您在此错误之前执行的操作。

有关此错误的详细信息可能在服务器错误日志中提供。

另外 ,尝试使用ErrorDo时遇到500内部服务器错误错误 要处理请求。

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题