簡體   English   中英

如何讓 apache 從克隆到我的 EC2 實例中的 github 存儲庫中的文件夾中加載索引文件?

[英]How do I get apache to load an index file inside a folder from a github repo that is cloned into my EC2 instance?

我已經在我的 EC2 實例上安裝了 apache,但無法配置 my.htacess 以重定向到位於文件夾內的索引文件。

這就是我所擁有的:

RewriteEngine on

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

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html`

我試圖將位於存儲庫文件夾中的 index.html 文件用作索引頁。

如果將 Apache 文檔根目錄配置為存儲庫文件夾,則不需要重定向。 請務必將默認索引文件設置為 index.html(可能是默認值)。

<VirtualHost *:80>
   DocumentRoot "/home/git/public_html/my_repo_name"
   ServerName www.mydomain.com
   DirectoryIndex index.html
</VirtualHost>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM