sergio-s/yii2-blog/master/.htaccess - Htaccess File

sergio-s/yii2-blog/master/.htaccess

# Mod_Autoindex
<IfModule mod_autoindex.c>
    # Disable Indexes
    Options -Indexes
</IfModule>

# Mod_Rewrite
<IfModule mod_rewrite.c>
    # Enable symlinks
    Options +FollowSymlinks
    # Enable mod_rewrite
    RewriteEngine On

    # Backend redirect
    RewriteCond %{REQUEST_URI} ^/backend
    RewriteRule ^backend/(.*)$ backend/web/$1 [L]

    # Statics redirect
    RewriteCond %{REQUEST_URI} ^/phpm
    RewriteRule ^phpm/(.*)$ phpm/$1 [L]

    # Frontend redirect
    RewriteCond %{REQUEST_URI} ^(.*)$
    RewriteRule ^(.*)$ frontend/web/$1
</IfModule>

#Options FollowSymLinks
#AddDefaultCharset utf-8
#<IfModule mod_rewrite.c>
#RewriteEngine On
## the main rewrite rule for the frontend application
#RewriteCond %{REQUEST_URI} !^/(backend/web|admin)
#RewriteRule !^frontend/web /frontend/web%{REQUEST_URI} [L]
## redirect to the page without a trailing slash (uncomment if necessary)
##RewriteCond %{REQUEST_URI} ^/admin/$
##RewriteRule ^(admin)/ /$1 [L,R=301]
## the main rewrite rule for the backend application
#RewriteCond %{REQUEST_URI} ^/admin
#RewriteRule ^admin(.*) /backend/web/$1 [L]
## if a directory or a file of the frontend application exists, use the request directly
#RewriteCond %{REQUEST_URI} ^/frontend/web
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
## otherwise forward the request to index.php
#RewriteRule . /frontend/web/index.php [L]
## if a directory or a file of the backend application exists, use the request directly
#RewriteCond %{REQUEST_URI} ^/backend/web
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
## otherwise forward the request to index.php
#RewriteRule . /backend/web/index.php [L]
#RewriteCond %{REQUEST_URI} .(htaccess|htpasswd|svn|git)
#RewriteRule .(htaccess|htpasswd|svn|git) - [F]
#</IfModule>

On Github License

Files

Download PDF of Htaccess file
REQUEST_FILENAME, REQUEST_URI

Comments

Apache