Changing the root folder via .htaccess

后端 未结 4 1019
庸人自扰
庸人自扰 2020-12-01 16:41

I\'ve got a shared hosting account associated with a domain name and the root folder (correct me if that\'s the wrong term) is set to / so that all files on the

4条回答
  •  时光取名叫无心
    2020-12-01 17:21

    This is how i always use it in my framework:

    Rewritecond %{REQUEST_FILENAME} !-f
    RewriteRule (.*) /example.com/public/$1 [L,NC]  
    
    RewriteCond %{REQUEST_URI}  ^/$
    RewriteRule !^example.com/public/(.*) /example.com/public/$1 [L,NC]
    

提交回复
热议问题