You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Peter Ferrigan <pe...@mci.com> on 2003/04/17 23:29:34 UTC

[users@httpd] Mod_rewrite help

Good evening, all.

I need some help with the mod_rewrite in Apache 1.3.27 (Solaris
9/Sparc).  I've been presented with a problem where my company changed
it's domain name.  I need to force anything going to the old domain to
the new one and I cannot do this with DNS (long story)

Pretty much like this:

Hostname.olddomain.com

Needs to go to

Hostname.newdomain.com

I've tried redirects, but that doesn't take into account any directory
that the user may have typed in.  So, in an ideal world it would work
like this:

Hostname.olddomain.com/whateveritype  will end up at
hostname.newdomain.com/whateveritype

To add to this mess, I've also got Virtual hosts, but they all have the
same domain name.  ie:

Host1.domain.com
Host2.domain.com
Etc..

They also need to point over to the new domain name, regardless of what
resource the user is trying access

Can anyone lend me a hand with this?

Thanks in advance!

- Peter 




---------------------------------------------------------------------
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] Mod_rewrite help

Posted by Jurgen <ap...@squarehosting.com>.
Hi,

it is better to put it only in the virtual server configs it should
apply to.

Jurgen


On Thu, 17 Apr 2003 16:49:27 -0500
"Peter Ferrigan" <pe...@mci.com> wrote:

> Would I put this in the general server config or put it in each
virtual> server config.
> 
> Thanks for the help guys.
> 
> 
> 
> -----Original Message-----
> From: Jurgen [mailto:apache@squarehosting.com] 
> Sent: Thursday, April 17, 2003 4:48 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Mod_rewrite help
> 
> 
> Ok I should have read the whole email.
> 
> something like this should work, but I didn't test it.
> RewriteEngine On
> RewriteCond %{HTTP_HOST} ^([^.]\.)?olddomain\.com
> RewriteRule (.*) http://%1newdomain.com$1
> 
> You might need to consider case sensitivity with the %{HTTP_HOST}
> 
> Jurgen
> 
> 
> On Thu, 17 Apr 2003 16:29:34 -0500
> "Peter Ferrigan" <pe...@mci.com> wrote:
> 
> > 
> > Good evening, all.
> > 
> > I need some help with the mod_rewrite in Apache 1.3.27 (Solaris
> > 9/Sparc).  I've been presented with a problem where my company
changed> > it's domain name.  I need to force anything going to the old
domain to> > the new one and I cannot do this with DNS (long story)
> > 
> > Pretty much like this:
> > 
> > Hostname.olddomain.com
> > 
> > Needs to go to
> > 
> > Hostname.newdomain.com
> > 
> > I've tried redirects, but that doesn't take into account any
directory> > that the user may have typed in.  So, in an ideal world it
would work> > like this:
> > 
> > Hostname.olddomain.com/whateveritype  will end up at
> > hostname.newdomain.com/whateveritype
> > 
> > To add to this mess, I've also got Virtual hosts, but they all have
> the> same domain name.  ie:
> > 
> > Host1.domain.com
> > Host2.domain.com
> > Etc..
> > 
> > They also need to point over to the new domain name, regardless of
> what> resource the user is trying access
> > 
> > Can anyone lend me a hand with this?
> > 
> > Thanks in advance!
> > 
> > - Peter 
> > 
> > 
> > 
> > 
> >
---------------------------------------------------------------------> >
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
> 
> 
> 
> ---------------------------------------------------------------------
> 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


[users@httpd] Strange Error Message in Apache Error Log

Posted by Leon Oosterwijk <le...@daveramsey.com>.
All,

I've looked in the mailing list archives and have found various clues
referring to the problem I'm having but was not able to get a solid answer.

I'm running Apache 2.0.45 (but had the same problem with .44) on Windows
2000 with SSL. In my error log I see these:

[Thu Apr 17 16:57:01 2003] [warn] (OS 121)The semaphore timeout period has
expired.  : winnt_accept: Asynchronous AcceptEx failed.
[Thu Apr 17 16:57:01 2003] [warn] (OS 64)The specified network name is no
longer available.  : winnt_accept: Asynchronous AcceptEx failed.

I get several of these per minute. The site is pretty busy ( 8.54
requests/sec  ) and don't know If i need to worry about these. The archives
talk about this being a windows problems not an apache issue. still I'd like
to know if and when a fix is expected. Also does this problem indicate that
people are having problems with our site. I surf the site extensively and
never have it act up on me, but need to be sure others have the same
experience.

Thank you for your assistance,

Leon Oosterwijk
www.daveramsey.com




---------------------------------------------------------------------
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] Mod_rewrite help

Posted by Peter Ferrigan <pe...@mci.com>.
Would I put this in the general server config or put it in each virtual
server config.

Thanks for the help guys.



-----Original Message-----
From: Jurgen [mailto:apache@squarehosting.com] 
Sent: Thursday, April 17, 2003 4:48 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Mod_rewrite help


Ok I should have read the whole email.

something like this should work, but I didn't test it.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^.]\.)?olddomain\.com
RewriteRule (.*) http://%1newdomain.com$1

You might need to consider case sensitivity with the %{HTTP_HOST}

Jurgen


On Thu, 17 Apr 2003 16:29:34 -0500
"Peter Ferrigan" <pe...@mci.com> wrote:

> 
> Good evening, all.
> 
> I need some help with the mod_rewrite in Apache 1.3.27 (Solaris
> 9/Sparc).  I've been presented with a problem where my company changed
> it's domain name.  I need to force anything going to the old domain to
> the new one and I cannot do this with DNS (long story)
> 
> Pretty much like this:
> 
> Hostname.olddomain.com
> 
> Needs to go to
> 
> Hostname.newdomain.com
> 
> I've tried redirects, but that doesn't take into account any directory
> that the user may have typed in.  So, in an ideal world it would work
> like this:
> 
> Hostname.olddomain.com/whateveritype  will end up at
> hostname.newdomain.com/whateveritype
> 
> To add to this mess, I've also got Virtual hosts, but they all have
the> same domain name.  ie:
> 
> Host1.domain.com
> Host2.domain.com
> Etc..
> 
> They also need to point over to the new domain name, regardless of
what> resource the user is trying access
> 
> Can anyone lend me a hand with this?
> 
> Thanks in advance!
> 
> - Peter 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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



---------------------------------------------------------------------
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] Mod_rewrite help

Posted by Jurgen <ap...@squarehosting.com>.
Ok I should have read the whole email.

something like this should work, but I didn't test it.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^.]\.)?olddomain\.com
RewriteRule (.*) http://%1newdomain.com$1

You might need to consider case sensitivity with the %{HTTP_HOST}

Jurgen


On Thu, 17 Apr 2003 16:29:34 -0500
"Peter Ferrigan" <pe...@mci.com> wrote:

> 
> Good evening, all.
> 
> I need some help with the mod_rewrite in Apache 1.3.27 (Solaris
> 9/Sparc).  I've been presented with a problem where my company changed
> it's domain name.  I need to force anything going to the old domain to
> the new one and I cannot do this with DNS (long story)
> 
> Pretty much like this:
> 
> Hostname.olddomain.com
> 
> Needs to go to
> 
> Hostname.newdomain.com
> 
> I've tried redirects, but that doesn't take into account any directory
> that the user may have typed in.  So, in an ideal world it would work
> like this:
> 
> Hostname.olddomain.com/whateveritype  will end up at
> hostname.newdomain.com/whateveritype
> 
> To add to this mess, I've also got Virtual hosts, but they all have
the> same domain name.  ie:
> 
> Host1.domain.com
> Host2.domain.com
> Etc..
> 
> They also need to point over to the new domain name, regardless of
what> resource the user is trying access
> 
> Can anyone lend me a hand with this?
> 
> Thanks in advance!
> 
> - Peter 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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] Mod_rewrite help

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 17 Apr 2003, Peter Ferrigan wrote:
> Pretty much like this:
>
> Hostname.olddomain.com
>
> Needs to go to
>
> Hostname.newdomain.com
>
> I've tried redirects, but that doesn't take into account any directory
> that the user may have typed in.

Uhhh... Yes they do.

> To add to this mess, I've also got Virtual hosts, but they all have the
> same domain name.  ie:
>
> Host1.domain.com
> Host2.domain.com
> Etc..

RewriteEngine On
RewriteCond %{HTTP_HOST} ([a-z]*)\.olddomain\.com$ [NC]
RerwiteRule ^/(.*) http://%1.newdomain.com/$1

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] Mod_rewrite help

Posted by Jurgen <ap...@squarehosting.com>.
Hi,

if there is no other way, with mod_rewrite you can simply do this in the
VirtualHost configuration:

RewriteEngine On
RewrriteRule ^(.*)  http://newdomain.com$1 [R]

Jurgen


On Thu, 17 Apr 2003 16:29:34 -0500
"Peter Ferrigan" <pe...@mci.com> wrote:

> 
> Good evening, all.
> 
> I need some help with the mod_rewrite in Apache 1.3.27 (Solaris
> 9/Sparc).  I've been presented with a problem where my company changed
> it's domain name.  I need to force anything going to the old domain to
> the new one and I cannot do this with DNS (long story)
> 
> Pretty much like this:
> 
> Hostname.olddomain.com
> 
> Needs to go to
> 
> Hostname.newdomain.com
> 
> I've tried redirects, but that doesn't take into account any directory
> that the user may have typed in.  So, in an ideal world it would work
> like this:
> 
> Hostname.olddomain.com/whateveritype  will end up at
> hostname.newdomain.com/whateveritype
> 
> To add to this mess, I've also got Virtual hosts, but they all have
the> same domain name.  ie:
> 
> Host1.domain.com
> Host2.domain.com
> Etc..
> 
> They also need to point over to the new domain name, regardless of
what> resource the user is trying access
> 
> Can anyone lend me a hand with this?
> 
> Thanks in advance!
> 
> - Peter 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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