Press "Enter" to skip to content

Configuration .htaccess Apache


Last updated on 6 Jan 2022

Yii2 Framework – Configuration .htacces Apache

Berikut ini adalah contoh konfigurasi Yii2 Framework di Apache

RewriteEngine On

# End the processing, if a rewrite already occurred
RewriteRule ^(frontend|backend)/web/ - [L]

# Handle the case of backend, skip ([S=1]) the following rule, if current matched
RewriteRule ^admin(/(.*))?$ backend/web/$2 [S=1]

# handle the case of frontend
RewriteRule .* frontend/web/$0

# Uncomment the following, if you want speaking URL
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+/web)/.*$ $1/index.php