Hei, I still have problems. My Virtual Host is: <VirtualHost *> DocumentRoot c:/www/myhp.dk/www ServerName myhp.dk ServerAlias *.myhp.dk ServerAdmin admin@xxxxxxx php_admin_value open_basedir c:/www/myhp.dk/www/ CustomLog c:/www/myhp.dk/access.log combined ErrorLog c:/www/myhp.dk/error.log RewriteEngine On RewriteCond %{HTTP_HOST} ^([^.]+)\.myhp\.dk$ RewriteCond %1 !^www$ RewriteCond c:/www/myhp.dk/www/%1 -d RewriteRule ^(.*) /%1/$1 [L] </VirtualHost> I restart Apache without any errors, but when I visit myhp.dk I get this error on the server: The requested operation has failed. Can you help me? Any logs? Med venlig hilsen / Best regards Dennis Madsen -----Oprindelig meddelelse----- Fra: Robert Ionescu [mailto:robsiegen@xxxxxxxxxxxxxx] Sendt: 3. marts 2006 15:01 Til: users@xxxxxxxxxxxxxxxx Emne: Re: SV: [users@httpd] Rewrite on Windows-server (subdomain) Dennis Madsen wrote: > Should I insert a rewrite rule in my virtual host for myhp.dk? I have this: > > <VirtualHost *> > DocumentRoot c:/www/myhp.dk/www > ServerName myhp.dk > ServerAlias *.myhp.dk > ServerAdmin admin@xxxxxxx > php_admin_value open_basedir c:/www/myhp.dk/www/ > CustomLog c:/www/myhp.dk/access.log combined > ErrorLog c:/www/myhp.dk/error.log > </VirtualHost> Hello Dennis. In this case (rewrite within the document root), you can easily use inside your <virtualhost *> (just add the rules somewhere between the other directives): RewriteEngine On RewriteCond %{HTTP_HOST} ^([^.]+)\.myhp\.dk$ RewriteCond %1 !^www$ RewriteCond c:/www/myhp.dk/www/%1 -d RewriteRule ^(.*) /%1/$1 [L] You don't need any looping protection here, because there is no internal redirect in per-server context. Since you're on a windows system, there are no concerns about security. But if would use e.g. Linux, I'd strongly recommend to prefix the substitution with the document root (like RewriteRule ^(.*) /var/www/html/%1/$1 [L]), but again, there is no need here to use RewriteRule ^(.*) c:/www/myhp.dk/www/%1/$1 [L] So you might test the rules inside your <virtualhost *>. -- Robert --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx