生产中的内部服务器错误,但不在本地,也不在“/”路由上

Internal Server Error in Production, but not in Local, and not on "/" route

开发了一个 Slim(PHP 微框架)应用程序。它在本地主机上工作,但在生产中出现错误 500。详情如下:

Internal Server Error : The server encountered an internal error or misconfiguration. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

感谢您提供解决问题的想法!

你能试试这个 .htaccess 文件吗?

# Redirect to front controller
RewriteEngine On
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L] 

你可以试试这个,它是为一个旧项目工作的

<IfModule mod_rewrite.c>
    # Activate this if you need to follow symlinks
    #Options +FollowSymlinks
    RewriteEngine On

    # Explicitly disable rewriting for front controller
    RewriteRule ^index.php - [L] RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ /index.php [QSA,L]
</IfModule>