Reputation: 87
I am new in yii2, When I extract yii2 advanced content from an archive with "basic application template", "Yii 2 with advanced application template" and when I upload on server, it's showing blank page.
I checked yii2 basic it's working fine but only in case of advance template getting blank page.
The advanced template url is like: ../advanced/frontend/web/index.php?r=site
But getting Error: No input file specified.
on Apache Server, getting this error:
Not Found The requested URL advanced/backend/web/index.php was not found on this server.
I tried installing from composer as well as from an archive but getting same and no index file exists inside backend/web/ and frontend/web/.
Edit:
As Jichao suggested, I tried making subdomain which points to the advanced/backend/web, But still the problem is same.
Scrrenshot:
Upvotes: 4
Views: 2502
Reputation: 16216
Add .htaccess
file into the root directory of your project. You should do it manually after yii2 installation. Simple example of the .htaccess
file:
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ frontend/web/$1 [L]
</IfModule>
# Deny accessing below extensions
<Files ~ "(.json|.lock|.git)">
Order allow,deny
Deny from all
</Files>
# Deny accessing dot files
RewriteRule (^\.|/\.) - [F]
Upvotes: 2