【问题标题】:laravel internal 500 errorlaravel 内部 500 错误
【发布时间】:2013-06-21 17:00:27
【问题描述】:
我将我的网站上传到使用 Windows Server 2008 r2 的服务器,但我遇到了问题(我认为这是由于 .htaccess 文件引起的)我收到内部 500 错误消息,我正在使用 xampp
我的网站不是直接在 htdocs 文件夹上,而是在 htdocs/server/ 上,这可能是个问题?
这也是我的 .htaccess 文件
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
谢谢
【问题讨论】:
标签:
.htaccess
laravel
internal
【解决方案1】:
我认为 Windows Server 不会服从您的 .htaccess。
尝试在 webconfig 文件中定义相同的逻辑。
首先,您需要将其指向您的网站根目录,即公共文件夹。
然后在这个文件夹中,试试这个web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
<add value="default.aspx" />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="index.html" />
</files>
</defaultDocument>
<handlers accessPolicy="Read, Execute, Script" />
<rewrite>
<rules>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
最好的祝福