Use a subdirectory as root with htaccess in Apache 1.3

后端 未结 3 1194
感动是毒
感动是毒 2020-12-22 19:43

I\'m trying to deploy a site generated with Jekyll and would like to keep the site in its own subfolder on my server to keep everything more organized.

Essentially,

3条回答
  •  北海茫月
    2020-12-22 19:59

    The only simple solution worked for me is here

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR]
    RewriteCond %{HTTP_HOST} ^www.domain-name.com$
    RewriteCond %{REQUEST_URI} !folder/
    RewriteRule (.*) /folder/$1 [L]
    

    Put this code into your .htaccess file.

    domain-name.com – Type your own domain name

    folder – Type the name of the subfolder which has the test/development website

提交回复
热议问题