Thursday, January 22, 2009

Web hosting with Apache and laziness.

For a while I had been ignoring a niggling little issue with my home hosted web site at When you entered the web address the url actually served was Finally I found a straightforward explanation of virtual hosts and using redirect matching which all came together and worked. Here is the link.

1 comment:

  1. been a apache sys admin 1998 to 2002 for in house app that's used by tens or hundreds of e-stores. Its config and doc is the worst in unix possible.

    if you site is hosted, to redirect, usually all you have to do is to add lines in a file named “.htaccess”. e.g. here's some lines from my current config:

    RewriteEngine on

    # deal with my moving files or reorg
    # RewriteCond 1 1
    RewriteRule ^Periodic_dosage_dir/20031107_hiphop.html$ [L]

    # block image leechers
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^|^$ [NC]
    RewriteRule \.(png|gif|jpg|jpeg|mov|mp3|wav|ico)$ - [NC,F]

    # forbid bots that whack entire site
    RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro||Missigua|HTTrack|WebCopier|Microsoft\ URL\ Control|Indy\ Library|WebCapture
    RewriteRule ^.+$ - [F,L]