Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // in .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
- // in config/web.php
- 'components' => [
- // ...
- 'urlManager' => [
- 'class' => 'yii\web\UrlManager',
- // Hide index.php
- 'showScriptName' => false,
- // Use pretty URLs
- 'enablePrettyUrl' => true,
- 'rules' => [
- '<alias:\w+>' => 'site/<alias>',
- ],
- ],
- // ...
- ],
Add Comment
Please, Sign In to add comment