httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis Madsen" <den...@demaweb.dk>
Subject SV: SV: [users@httpd] Rewrite on Windows-server (subdomain)
Date Sun, 05 Mar 2006 18:38:46 GMT
Sorry, but can you help me?

Med venlig hilsen / Best regards
Dennis Madsen
 
DeMaWeb
http://www.demaweb.dk
CVR-nr.: 2895 9486
-----Oprindelig meddelelse-----
Fra: Robert Ionescu [mailto:robsiegen@googlemail.com] 
Sendt: 3. marts 2006 15:01
Til: users@httpd.apache.org
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@myhp.dk
> 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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message