Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save frank4565/5636007 to your computer and use it in GitHub Desktop.
Save frank4565/5636007 to your computer and use it in GitHub Desktop.

Alias an Apache web directory to a git repository.

  1. Open httpd.conf.

  2. Find <IfModule alias_module> ... </IfModule> block.

  3. Add Alias <url-path> <path-in-git-repository>. Change the <url-path> to whatever you want to show in url. e.g. If you want the whole url be www.example.com/auto/, the set <url-path> to be /auto/. Change the <path-in-git-repository> to the path where your server code exists under the git repostory.

  4. Add the following to the last line you added.

    <Directory <path-in-git-repository> >
    Order allow,deny
    Allow from all
    </Directory>
    
  5. Restart Apache, then it should works if you typing the url you just set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment