Yii 2.0 hiding /basic/web from the URL along with the index.php

前端 未结 3 734
轮回少年
轮回少年 2021-01-06 17:09

Plenty of information around the net on how to hide the index.php from your Yii 2.0 application URL, however, what I\'m trying to do here is to also remove the \'/basic/web/

3条回答
  •  走了就别回头了
    2021-01-06 17:53

    You should define your apache configuration in another way. Your site should point to {folder}/basic/web and not to {folder}.

    Because you changed the requirements:

    For a cpanel setup you should:
    1) remove the silly basic folder, what is the point of it anyway? Just because Yii installs that way does not mean you have to keep it. So move everything 1 level up.
    2) Rename web to public_html make sure you rename it in some files too (config/bootstrap comes to mind).

    Yes you can do it with .htaccess but you should not have the files exposed to the internet, just your web folder should be exposed so I am not giving you that solution because it is not a good one.

提交回复
热议问题