Re: Apache URL redirect

From: Brian Tingle <brian.tingle.cdlib.org_at_nyob>
Date: Thu, 3 Feb 2011 14:01:20 -0800
To: CODE4LIB_at_LISTSERV.ND.EDU
Redirect does not look the hostname, just the path

I think you have two options;

1) set up a "named based virtual host" for www.partnersinreading.org
In that name based virtual host, set up your Redirect /
http://www.sjpl.org/par

2) if you are using mod_rewrite, you could do something like this.

RewriteCond %{HTTP_HOST} ^.*partnersinreading\.org$
RewriteRule ^/(.*)$ http://www.sjpl.org/par$1 [R,NE]

hope that helps,

-- Brian

On Thu, Feb 3, 2011 at 1:42 PM, Nate Hill <nathanielhill_at_gmail.com> wrote:
> Hi - I'm new to Apache and hope that someone out there might be able to help
> me with a configuration issue over at San Jose Public Library.
>
> I need to have the URL www.partnersinreading.org redirect to
> http://www.sjpl.org/par
> Right now if you go to www.partnersinreading.org it takes you to the root,
> sjpl.org and then if you navigate through the site all the urls are
> rewritten with partnersinreading as the root.
> That's no good.
>
> I went into Apache's httpd.conf file and added in the mod_alias area:
> Redirect permanent http://www.partnersinreading.org/ http://www.sjpl.org/par
>
> I'm assuming this is not a DNS issue...
>
> This isn't the right approach.
>
> Any input would be appreciated, its rather unnerving to have no experience
> with this and be expected to make it work.
>
>
> --
> Nate Hill
> nathanielhill_at_gmail.com
> http://www.natehill.net
>
Received on Thu Feb 03 2011 - 17:01:39 EST