SV: [users@httpd] Rewrite on Windows-server (subdomain)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hei Robert,

Thanks for your answer.

Sorry, but I don't understand, that you tell me to do?
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>

Which rewrite rule should I insert?

Best Regards
Dennis Madsen

-----Oprindelig meddelelse-----
Fra: Robert Ionescu [mailto:robsiegen@xxxxxxxxxxxxxx] 
Sendt: 2. marts 2006 22:46
Til: users@xxxxxxxxxxxxxxxx
Emne: Re: [users@httpd] Rewrite on Windows-server (subdomain)

Dennis Madsen wrote:
> I have this rewrite rule:
> 
> RewriteEngine On
> RewriteCond %{HTTP_HOST} ^([^.]+)\.myhp\.dk$
> RewriteCond %{1} !^www$
> RewriteCond c:/www/myhp.dk/www/%1 -d
> RewriteCond %{REQUEST_FILENAME} !^c:/www/myhp.dk/www/
> RewriteRule (.*) c:/www/myhp.dk/www/%1/$1 [l]

You cannot rewrite to a full physical path in per-dir context (i.e.
.htaccess configuration files, <directory...> and <location...>
sections). mod_rewrite needs an URL-path (e.g. /abc/) here for the
internal redirect.
But mod_rewrite fails here to built such an URL-path (which is always
tried if you don't rewrite directly to an URL-path).

Place your rules in your httpd.conf (=per-server context; if you're
using <virtualhosts..> in the vhost, otherwise outside of <...>-sections.

You should be able to rewrite to a full physical path in per-server context.

IMHO placing directives directly into httpd.conf should be always 
preferred instead of using .htaccess.

-- 
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



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux