Guest User

Untitled

a guest
Dec 11th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. // in .htaccess
  2. RewriteEngine on
  3. # If a directory or a file exists, use it directly
  4. RewriteCond %{REQUEST_FILENAME} !-f
  5. RewriteCond %{REQUEST_FILENAME} !-d
  6. # Otherwise forward it to index.php
  7. RewriteRule . index.php
  8.  
  9.  
  10. // in config/web.php
  11. 'components' => [
  12. // ...
  13. 'urlManager' => [
  14. 'class' => 'yii\web\UrlManager',
  15. // Hide index.php
  16. 'showScriptName' => false,
  17. // Use pretty URLs
  18. 'enablePrettyUrl' => true,
  19. 'rules' => [
  20. '<alias:\w+>' => 'site/<alias>',
  21. ],
  22. ],
  23. // ...
  24. ],
Add Comment
Please, Sign In to add comment