From owner-freebsd-questions@FreeBSD.ORG Fri Sep 28 20:18:20 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2BEF1065672 for ; Fri, 28 Sep 2012 20:18:19 +0000 (UTC) (envelope-from jacks@sage-american.com) Received: from mail.sagedata.net (mail.sagedata.net [38.106.15.121]) by mx1.freebsd.org (Postfix) with ESMTP id CF94B8FC0C for ; Fri, 28 Sep 2012 20:18:19 +0000 (UTC) Received: from [192.168.1.67] (99-111-143-21.lightspeed.crchtx.sbcglobal.net [99.111.143.21]) by mail.sagedata.net (8.14.5/8.14.5) with ESMTP id q8SK7uFt005921 for ; Fri, 28 Sep 2012 15:07:56 -0500 (CDT) (envelope-from jacks@sage-american.com) X-Authentication-Warning: mail.sagedata.net: Host 99-111-143-21.lightspeed.crchtx.sbcglobal.net [99.111.143.21] claimed to be [192.168.1.67] Message-ID: <506603BC.8000202@sage-american.com> Date: Fri, 28 Sep 2012 15:08:28 -0500 From: Jack Stone User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: milter-spamc/1.15.388 (mail.sagedata.net [38.106.15.121]); Fri, 28 Sep 2012 15:07:57 -0500 X-Spam-Status: NO, hits=-10.00 required=4.50 X-Spam-Report: Content analysis details: (-10.0 points, 4.5 required) | | pts rule name description | ---- ---------------------- -------------------------------------------------- | -0.0 SHORTCIRCUIT Not all rules were run, due to a shortcircuited rule | -10 ALL_TRUSTED Passed through trusted hosts only via SMTP | Subject: Rewrite redirects X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Sep 2012 20:18:20 -0000 I thought I had this figured out but discovered I have a BIG flaw with my .htaccess redirects After days of searching and experimenting, I still can't get this to do what I intended. I have moved all of the content on a web site from the web root to a different directory. Now I need toredirect the URL requests from the old location to the new one. Instead of issuing a 301 error, I want to first redirect to an info page, let's call it "info.htm." Here's what I have now in the web root's .htaccess. Here's the way it was/is: ~webroot/lots_of.html ....and now changed to this: ~webroot/content/lots_of.html Using the apache mod_rewritein .htaccess RewriteEngine on RewriteRule /~webroot/(.*\.html) /^info.htm [PT] ....which is supposed to redirect any page with the extension ".html" to the info.htm page. BUT, alas any "*.html page in any directory will redirect back to the info.htm page!! What I wanted is that only the "*.html pages in the ~webroot to be redirected to the info page. I hope this make sense and I hope someone can give me a tip on how to limit the redirects to only the webroot pages. Thanks in advance..... -- -- All the best, Jack