我们在yii2中建立了一个项目。在本地服务器上工作正常。但是它不能在共享服务器上工作。我在htaccess中尝试了很多,但仍然对我不起作用,这给了我500个内部服务器错误
前端htaccess:
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
后端htaccess
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
我怎么解决这个问题 ?
服务器可能不支持16位.php文件。当您将文件另存为UTF-8时,某些编辑器(例如Windows上的记事本)将始终添加字节顺序标记(BOM),因此请确保使用文本编辑器来保存不带BOM的文件。我遇到了完全相同的问题,并且花了我很多时间来调试问题,因为两种格式的文本在查看时看起来都相同。使用session_start()时,问题非常棘手,因为该文件必须以
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句