开发了一个Slim(PHP微框架)应用程序。它在localhost中工作,但在生产中收到错误500。以下是详细信息:
内部服务器错误:服务器遇到内部错误或配置错误。此外,尝试使用ErrorDocument处理请求时遇到500内部服务器错误错误。
感谢您的想法来管理这个问题!
你可以尝试这个,它适用于一个旧项目
<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>
你可以试试这个.htaccess
文件吗?
# Redirect to front controller
RewriteEngine On
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]