Absolute Path for Deployment in a Non-Root Location

后端 未结 8 1305
耶瑟儿~
耶瑟儿~ 2021-01-06 13:22

I typically refer to any assets on my site using absolute path so that I don\'t have to worry about the location of the assets relative to current file.

<         


        
8条回答
  •  走了就别回头了
    2021-01-06 13:38

    try to add this to your .htaccess

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?DOMAINNAME.com$
    RewriteCond %{REQUEST_URI} !^/holiday/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /holiday/$1
    RewriteCond %{HTTP_HOST} ^(www.)?DOMAINNAME.com$
    RewriteRule ^(/)?$ holiday/index.php [L]
    

    or take a look here - Changing the root folder via .htaccess

提交回复
热议问题