# -*- apache -*-

<VirtualHost *:80>
    ServerName book.realworldhaskell.org
    ServerAdmin bos@serpentine.com
    ErrorLog logs/haskell-error_log
    CustomLog logs/haskell-access_log full
    Options +MultiViews
    DirectoryIndex index.html.var index.html
    DocumentRoot "/home/bos/src/darcs/book/en/html"

    Redirect permanent /buy/amazon-us http://www.amazon.com/gp/product/0596514980?ie=UTF8&tag=reaworhas-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=0596514980
    Redirect permanent /buy/amazon-ca http://www.amazon.ca/gp/product/0596514980?ie=UTF8&tag=reaworhas02-20&linkCode=as2&camp=15121&creative=330641&creativeASIN=0596514980
    Redirect permanent /buy/amazon-de http://www.amazon.de/gp/product/0596514980?ie=UTF8&tag=reaworhas09-21&linkCode=as2&camp=1638&creative=6742&creativeASIN=0596514980
    Redirect permanent /buy/amazon-uk http://www.amazon.co.uk/gp/product/0596514980?ie=UTF8&tag=reaworhas-21&linkCode=as2&camp=1634&creative=6738&creativeASIN=0596514980
    Redirect permanent /buy/powells-us http://www.powells.com/partner/33317/biblio/9780596514983

    # Actively redirect requests via a ServerAlias to the canonical hostname.
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !=book.realworldhaskell.org
    RewriteRule ^(.*) http://book.realworldhaskell.org$1 [R]

    <Location "/">
        SetHandler python-program
        PythonPath "['/home/bos/svn/django', '/home/bos/src/darcs/book/web'] + sys.path"
        PythonHandler django.core.handlers.modpython
        PythonAutoReload Off
        SetEnv DJANGO_SETTINGS_MODULE rwh.settings
        PythonDebug Off
    </Location>

    <Location ~ "^/$">
        SetHandler None
        DirectoryIndex index.html
    </Location>

    <Location ~ "^/index.html">
        SetHandler None
    </Location>

    <Location ~ "^/robots.txt">
        SetHandler None
    </Location>

    <Location "/alpha">
        SetHandler None
    </Location>

    <Location "/beta">
        SetHandler None
    </Location>

    <Location "/complete">
        SetHandler None
    </Location>

    <Location "/support">
        SetHandler None
    </Location>

    <Location "/media">
        SetHandler None
    </Location>

    Alias /media /home/bos/svn/django/django/contrib/admin/media

    <Directory "/home/bos/src/darcs/book/en/html">
        Options Indexes FollowSymlinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    <Directory "/home/bos/src/darcs/book/en/html/alpha">
        AllowOverride AuthConfig
    </Directory>

    <Directory "/home/bos/src/darcs/book/en/html/complete">
        AllowOverride AuthConfig
    </Directory>

    <Directory "/home/bos/src/darcs/book/en/html/support">
        Options None
    </Directory>
</VirtualHost>

<Directory "/home/bos/svn/django/django/contrib/admin/media">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
