Answer the question
In order to leave comments, you need to log in
How to deploy a project to yii2?
1. I have XAMPP
2. Uploaded a project to htdocs/project1 on Yii
DocumentRoot "E:/WebServer/htdocs/project1 /backend/web"
ServerName backend.project1.local
ServerAlias "backend.project1.local" "www.backend.project1 .local"
Registered in hosts
When I go to backend.project1.local , it redirects me to backend.project1.local/user/login
Error 404
What is missing?
Answer the question
In order to leave comments, you need to log in
In the web folder you need to throw the .htaccess file with the following content
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
XAMPP, it means you have Apache, it means go to getting started in the documentation, look for what it says about Apache and realize what you need to do. Wangyu, most likely something in .htaccess is not right.
If it redirects to user/login, then we open the controller and correct access. The index must be accessible to non-registered users.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question