简体   繁体   中英

yii2 frontend and backend not working on shared server

We had build one project in yii2. It is working fine on local server. But it not working on shared server. I tried lot in htaccess but still not working for me.It gives me 500 internal server error

Frontend 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

Backend 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

How can i solve this problem ?

Probably the server does not support 16-bit .php files. Some editors (such as Notepad on Windows) will always add a byte-order mark (BOM) when you save a file as UTF-8, so make sure you use a text editor where you can save the file without the BOM. I had exactly the same problem and it took me ages to debug the problem because the text in both formats looks identical when viewed. The problem is quite a show-stopper when using session_start() because the file must begin with

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM