Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 73400 invoked from network); 28 Jun 2007 18:40:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jun 2007 18:40:39 -0000 Received: (qmail 58244 invoked by uid 500); 28 Jun 2007 18:40:30 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 58217 invoked by uid 500); 28 Jun 2007 18:40:30 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 58185 invoked by uid 99); 28 Jun 2007 18:40:30 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 11:40:30 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [63.215.161.134] (HELO mx02.detroitonline.com) (63.215.161.134) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 11:40:22 -0700 Received: from d221-69-25.commercial.cgocable.net ([216.221.69.25] helo=[192.168.2.28]) by mx02.detroitonline.com with esmtpa (Exim 4.60) (envelope-from ) id 1I3ypJ-0001BC-Mp for users@httpd.apache.org; Thu, 28 Jun 2007 14:35:02 -0400 Message-ID: <46840085.70904@blazestudios.com> Date: Thu, 28 Jun 2007 14:40:05 -0400 From: "Tom Ray [Lists]" User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: users@httpd.apache.org References: <4683F3F3.8050206@blazestudios.com> <5C818D06-D196-4B51-90B7-D57BBEF51EDA@dakim.com> <4683F6EF.5080005@blazestudios.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] .htaccess issue with Apache 2.0.59 Well I got it working. I ended up having to do it like this: RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.nwdyc\.org [NC] RewriteRule ^.* http://nwdyckids.tripod.com/ [R,L] RewriteCond %{HTTP_HOST} ^nwdyc\.org [NC] RewriteRule ^.* http://nwdyckids.tripod.com/ [R,L] Making a separate condition for each URL variation. John Schofield wrote: > I'm no .htaccess expert -- I'm at the "I've read the docs and gotten a > few .htaccess rules working" stage. So take what I say with a grain of > salt. > > 1) You need to escape the periods in your regexes. It should be > ^www\.nwdyc\.org$, not ^www.nwdyc.org$. > > 2) Your rules will redirect traffic to ANY page at nwdyc.org to > nwdyckids.tripod.com. If that's what you want, fine. If you want to > redirect nwdyc.org/whatever to nwdyckids.tripod.com/whatever, you need > to do something else. You're using parenthesis to create a > backreference; you need to actually add the backreference back in, > like this: RewriteRule ^(.*)$ http://nwdyckids.tripod.com/$1 > > 3) I don't know why your IP-based rewrite rule isn't working. I've > never played with that. > > 4) Here's the complete, working rewrite rule for my site, > blog.sudosu.net: > >> RewriteEngine On >> RewriteBase / >> >> RewriteCond %{HTTP_HOST} ^www\.blog\.sudosu\.net$ >> RewriteRule ^(.*)$ http://blog.sudosu.net/$1 [L,R=301] >> >> RewriteCond %{REQUEST_FILENAME} !-f >> RewriteCond %{REQUEST_FILENAME} !-d >> RewriteRule . /index.php [L] > > > 5) Here are some notes: > >> RewriteCond %{HTTP_HOST} ^www\.blog\.sudosu\.net$ >> RewriteRule ^(.*)$ http://blog.sudosu.net/$1 [L,R=301] > > The above cond and rule redirect any traffic to www.blog.sudosu.net > (because some people think EVERY URL needs a "www" in front of it) to > blog.sudosu.net. The L means don't evaluate any further rules in the > .htaccess. The "R=301" means this is a permanent redirect -- your > browser's addrss bar should show the new address, not the old, and > search engines should replace the old URL in their indexes with the > new URL. That may or may not be what you want. > > > --JMS > > > > > > On Jun 28, 2007, at 10:59 AM, Tom Ray [Lists] wrote: > >> Well, DirectoryIndex works. So I'm assuming it is. I did put the >> gibberish in and I got a 500 error, so it's back to troubleshooting. >> >> John Schofield wrote: >>> First thing I would try is putting gibberish in your .htaccess file, >>> and see if you get an error when you load pages in the directory >>> containing the gibberish .htaccess file. If you don't get an error, >>> Apache isn't loading your .htaccess file. >>> >>> If you DO get an error, you can take out the gibberish and continue >>> troubleshooting. >>> >>> >>> --JMS >>> >>> >>> On Jun 28, 2007, at 10:46 AM, Tom Ray [Lists] wrote: >>> >>>> Hey, I'm using Apache 2.0.59 and I'm running into a bit of an issue >>>> here. I just can't seem to get the RewriteEngine command to work in >>>> .htaccess. I can get the other .htaccess directives >>>> (DirectoryIndex, password, etc) to work but not this. I have >>>> mod_rewrite.c in my list when I do httpd -l so I'm assuming I have >>>> the module installed. >>>> >>>> Here are the two entries I've tried but can't seem to get working. >>>> >>>> Here I want to redirect anyone who types in that domain to the >>>> tripod site. (Client request) >>>> RewriteEngine On >>>> RewriteCond %{HTTP_HOST} ^nwdyc.org [NC] >>>> RewriteCond %{HTTP_HOST} ^www.nwdyc.org [NC] >>>> RewriteRule ^(.*)$ http://nwdyckids.tripod.com/ [R,L] >>>> >>>> Here I was just trying to make the damn thing see my IP address and >>>> move me over to yahoo. >>>> RewriteEngine on >>>> RewriteCond %{REMOTE_ADDR} ^221.216.69.25$ >>>> RewriteRule ^(.*)$ http://www.yahoo.com [L] >>>> >>>> Neither of these seem to work. Is there something I'm doing wrong? >>>> >>>> --------------------------------------------------------------------- >>>> The official User-To-User support forum of the Apache HTTP Server >>>> Project. >>>> See 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 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 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 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 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