You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Declerck Michael-W30479 <W3...@motorola.com> on 2006/08/09 17:14:49 UTC

[users@httpd] grab header to redirect

Hello,
Is there a way to grab a header/DNS name using Apache 2.2?
A little background:
I have a primary DNS name and a secondary DNS name that maps to the same
IP address.
Right now, my Apache 2.2 configuration redirects the client directly to
the index.pl page using the directives:
<IfModule dir_module>
    DirectoryIndex index.pl
</IfModule>
when the DNS routes the client to my server.
 
The secondary DNS name will also route to the same IP, thus serving
index.pl for the second DNS name as well, which is not what I want to
do.
I have been informed that the secondary DNS name will not change in the
browser when it routes to the server.
 
Is there a way to grab this DNS name (would this be found as a header?)
and redirect the client based on what that name is?
I have a little bit of experience with mod_rewrite, but that experience
is nominal at best.
 
Any help or advice is appreciated,
Michael DeClerck

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


Re: [users@httpd] logging question

Posted by Joshua Slive <jo...@slive.ca>.
On 8/16/06, Farid Hamjavar <ha...@unm.edu> wrote:
>
>
> Apache 1.3.33  on Linux RH AS 3.0
>
> Greetings,
>
> Is there a way to instruct Apache not to log (in its access_log)
> entries from a certain things? e.g. not to log
> entries from IP# 1.2.3.4  or  from host hostname.site.org

http://httpd.apache.org/docs/1.3/logs.html#conditional

Joshua.

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


[users@httpd] logging question

Posted by Farid Hamjavar <ha...@unm.edu>.

Apache 1.3.33  on Linux RH AS 3.0

Greetings,

Is there a way to instruct Apache not to log (in its access_log)
entries from a certain things? e.g. not to log
entries from IP# 1.2.3.4  or  from host hostname.site.org 

Thanks,
Farid

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


Re: [users@httpd] grab header to redirect

Posted by Joshua Slive <jo...@slive.ca>.
On 8/15/06, Declerck Michael-W30479 <W3...@motorola.com> wrote:
> Can you be a bit more specific?
> The examples show how to redirect a file access to a specific URL.
> I want a specific URL to redirect to a file (a different page than the
> DirectoryIndex).
>
> Michael
>
> -----Original Message-----
> From: jslive@gmail.com [mailto:jslive@gmail.com] On Behalf Of Joshua
> Slive
> Sent: Wednesday, August 09, 2006 10:31 AM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] grab header to redirect
>
> On 8/9/06, Declerck Michael-W30479 <W3...@motorola.com> wrote:
> > Hello,
> > Is there a way to grab a header/DNS name using Apache 2.2?
> > A little background:
> > I have a primary DNS name and a secondary DNS name that maps to the
> > same IP address.
> > Right now, my Apache 2.2 configuration redirects the client directly
> > to the index.pl page using the directives:
> > <IfModule dir_module>
> >     DirectoryIndex index.pl
> > </IfModule>
> > when the DNS routes the client to my server.
> >
> > The secondary DNS name will also route to the same IP, thus serving
> > index.pl for the second DNS name as well, which is not what I want to
> > do.
> > I have been informed that the secondary DNS name will not change in
> > the browser when it routes to the server.
> >
> > Is there a way to grab this DNS name (would this be found as a
> > header?) and redirect the client based on what that name is?
> > I have a little bit of experience with mod_rewrite, but that
> > experience is nominal at best.
>
> Sounds like you are looking for:
> http://httpd.apache.org/docs/1.3/misc/FAQ.html#canonical-hostnames

NameVirtualHost *:80

<VirtualHost *:80>
ServerName PrimaryDNSName
DocumentRoot ...
DirectoryIndex index.pl
</VirtualHost *:80>

<VirtualHost *:80>
ServerName SecondaryDNSName
# It is not clear from your message what you want to do here.
# If you simply want to change SecondaryDNSName to PrimaryDNSName
# in the browser's location bar, use
Redirect / http://PrimaryDNSName/
# On the other hand, if you want to serve different content for the
# SecondaryDNSName, you can configure that content here...
DocumentRoot ...
DirectoryIndex index.html
...
</VirtualHost>

Joshua.

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


RE: [users@httpd] grab header to redirect

Posted by Declerck Michael-W30479 <W3...@motorola.com>.
Can you be a bit more specific?
The examples show how to redirect a file access to a specific URL.
I want a specific URL to redirect to a file (a different page than the
DirectoryIndex).

Michael

-----Original Message-----
From: jslive@gmail.com [mailto:jslive@gmail.com] On Behalf Of Joshua
Slive
Sent: Wednesday, August 09, 2006 10:31 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] grab header to redirect

On 8/9/06, Declerck Michael-W30479 <W3...@motorola.com> wrote:
> Hello,
> Is there a way to grab a header/DNS name using Apache 2.2?
> A little background:
> I have a primary DNS name and a secondary DNS name that maps to the 
> same IP address.
> Right now, my Apache 2.2 configuration redirects the client directly 
> to the index.pl page using the directives:
> <IfModule dir_module>
>     DirectoryIndex index.pl
> </IfModule>
> when the DNS routes the client to my server.
>
> The secondary DNS name will also route to the same IP, thus serving 
> index.pl for the second DNS name as well, which is not what I want to 
> do.
> I have been informed that the secondary DNS name will not change in 
> the browser when it routes to the server.
>
> Is there a way to grab this DNS name (would this be found as a 
> header?) and redirect the client based on what that name is?
> I have a little bit of experience with mod_rewrite, but that 
> experience is nominal at best.

Sounds like you are looking for:
http://httpd.apache.org/docs/1.3/misc/FAQ.html#canonical-hostnames

Joshua.

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


Re: [users@httpd] grab header to redirect

Posted by Joshua Slive <jo...@slive.ca>.
On 8/9/06, Declerck Michael-W30479 <W3...@motorola.com> wrote:
> Hello,
> Is there a way to grab a header/DNS name using Apache 2.2?
> A little background:
> I have a primary DNS name and a secondary DNS name that maps to the same
> IP address.
> Right now, my Apache 2.2 configuration redirects the client directly to
> the index.pl page using the directives:
> <IfModule dir_module>
>     DirectoryIndex index.pl
> </IfModule>
> when the DNS routes the client to my server.
>
> The secondary DNS name will also route to the same IP, thus serving
> index.pl for the second DNS name as well, which is not what I want to
> do.
> I have been informed that the secondary DNS name will not change in the
> browser when it routes to the server.
>
> Is there a way to grab this DNS name (would this be found as a header?)
> and redirect the client based on what that name is?
> I have a little bit of experience with mod_rewrite, but that experience
> is nominal at best.

Sounds like you are looking for:
http://httpd.apache.org/docs/1.3/misc/FAQ.html#canonical-hostnames

Joshua.

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