开发者

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

I've installed apache on my EC2 instance but can't configure my .htacess to redirect to an index file located inside a folder.

This is what I have:

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`

I was trying to have the index.开发者_高级运维html file that's located in the repository folder to be used as the index page.


If you configure your Apache document root to be the repository folder, no redirect is needed. Be sure to set your default index file to be index.html (probably the default).

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜