Enable clean URL in Yii2

后端 未结 11 1140
攒了一身酷
攒了一身酷 2020-11-27 12:36

How can I enable clean urls in Yii2. I want to remove index.php and \'?\' from url parameters. Which section needs to be edited in Yii2 for that?

11条回答
  •  失恋的感觉
    2020-11-27 13:04

    For me, the problem was:

    1. Missing .htaccess in the web folder just like mentioned above.
    2. The AllowOverride directive was set to None, which disabled URL rewrites. I changed it to All and now pretty URLs work nicely.
    
      Options Indexes 
      FollowSymLinks MultiViews 
      AllowOverride All 
      Require all granted
    
    

提交回复
热议问题