I am waiting for the Yii2.0. And I downloaded the basic yii 2.0 app from github. I like the directory structure. But I have a problem: I miss the .htaccess file.
I can’t hide the subfolder in my redirected URL by the .htaccess
RewriteEngine on
# If a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php
RewriteRule . index.php
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if request dosn't start with web add it
RewriteCond %{REQUEST_URI} !^/(web)
RewriteRule (.*) /web/$1
# if file or directory dosn't exists go to /web/index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /web/index.php
For Advanced Applications:
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if request begins with /admin remove admin and ad /backend/web/
RewriteCond %{REQUEST_URI} ^/admin
RewriteRule ^admin\/?(.*) /backend/web/$1
# other requests add /frontend/web/$1
RewriteCond %{REQUEST_URI} !^/(frontend/web|backend/web|admin)
RewriteRule (.*) /frontend/web/$1
# if frontend request
RewriteCond %{REQUEST_URI} ^/frontend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /frontend/web/index.php
# if backend request
RewriteCond %{REQUEST_URI} ^/backend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /backend/web/index.php
please, can you copy/paste the right .htaccess of provide us a link where we can find it?
I’ve the same problem and actually I’m stopped at the stage where my virtual host domain (web.app.it) open me the folders/files dir and do not execute the index.php …
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