0

i'm having a problem accessing the backend section of my advanced theme. Basically i can't access after make changes in .htaccess for frontend section. In root folder the .htaccess is:

RewriteOptions inherit
Options -Indexes
RewriteEngine on

<IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_URI} !^/frontend/web/(assets|css|stylesheets|images|js)/
    RewriteCond %{REQUEST_URI} !admin
    RewriteRule .* frontend/web/index.php [L]
</IfModule>

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
Fernando Madriaga
  • 438
  • 1
  • 6
  • 17
  • You need to configure backend rules in .htaccess too. See http://stackoverflow.com/questions/28118691/yii2-htaccess-how-to-hide-frontend-web-and-backend-web-completely –  Aug 27 '15 at 11:38

1 Answers1

0

When you enable the pretty url component in either frontend / backend application of the yii2-advenced template, make sure you create a .htaccess file under the web folder of the respective application with the following content

# use mod_rewrite for pretty URL support
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

NOTE: rewrite_module should be enabled in apache for this to work.

Henry Ohanga
  • 416
  • 3
  • 6