Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Could anyone help to with the following issue:

I'm trying to do a rewrite on all domains that won't match and push them to a given folder. The following vhost works locally (Mac OS X with XAMPP), but is not working on a Debian server:

<VirtualHost *:80>
UseCanonicalName On
ServerName www.domain.de
ServerAlias *
DocumentRoot "/var/www/www.domain.de/current/web"
DirectoryIndex index.php
Alias /sf /var/www/www.domain.de/current/lib/vendor/symfony/data/web/sf

ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined

SetEnv SYMFONY_ENVIROMENT prod

<Directory />
    Options +Includes 
    Options +FollowSymlinks 
    Options -Indexes
    AllowOverride All
    AuthType Basic
    AuthName "Info"
    AuthUserFile /var/www/www.domain.de/current/.htpasswd
    Require valid-user
</Directory>

<IfModule mod_rewrite.c>
    RewriteEngine On
    #RewriteLog "/var/www/www.domain.de/current/log/rewrite.log"
    RewriteLogLevel 3

    # Rewrites to host folder if not a main/my domain
    RewriteCond %{HTTP_HOST} !^(www\.)?domain.de|(www\.)?my-domain.(de|net|at|ch|eu|com)$
    RewriteRule ^(.*)$ /var/www/www.domain.de/current/websites/aliases/%{HTTP_HOST}/$1 [L]
</IfModule>

share|improve this question

1 Answer 1

on debian mod_rewrite is disabled by default. So try to enable it then restart apache

Enabling mod_rewrite

 a2enmod rewrite

Then restart apache

 /etc/init.d/apache2 restart

Then try the rules

share|improve this answer
    
Not the case unfortunately, throws "Module rewrite already enabled" –  Ain Sep 17 '12 at 12:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.