Return-Path: Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 25147 invoked by uid 500); 27 Aug 2003 02:33:31 -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: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 25105 invoked from network); 27 Aug 2003 02:33:30 -0000 Received: from unknown (HELO mail.iinet.net.au) (203.59.3.47) by daedalus.apache.org with SMTP; 27 Aug 2003 02:33:30 -0000 Received: (qmail 25914 invoked from network); 27 Aug 2003 02:26:10 -0000 Received: from unknown (HELO indent.com.au) (203.217.41.153) by mail.iinet.net.au with SMTP; 27 Aug 2003 02:26:10 -0000 Date: Wed, 27 Aug 2003 12:26:09 +1000 Mime-Version: 1.0 (Apple Message framework v552) Content-Type: text/plain; charset=US-ASCII; format=flowed From: Justin French To: apache Content-Transfer-Encoding: 7bit Message-Id: X-Mailer: Apple Mail (2.552) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: [users@httpd] help with rewrite please Hi all, I'm attempting (badly) to create a generic rewrite rule that I can use site-wide, rather than specific rules for each section, and on two different servers. For starters, on my LAN test server, the 'site' lives within a directory eg: LAN: domain.com/clientname/ Live: clientname.com/ The next 'block/' will always be the script name, eg products (products.html), so that needs to be captured for the rewrite as $1. From there, I will have anywhere from zero to 2 more 'blocks/' I'd also hope that the rewrite rules match regardless of a trailing / Some examples: domain.com/clientname/products/ (doesn't need a rewrite) domain.com/products/cd/ > products.php?1=cd domain.com/clientname/products/cd/45 > products.php?1=cd&2=45 domain.com/about/staff/ > about.php?1=staff domain.com/clientname/faq/something/foo > faq.php?1=something&2=foo Here's what I have in my .htaccess file so far, which is NOT working. --- Options +MultiViews RewriteEngine on # for LAN RewriteRule ^/clientname/(.*)/(.*) $1.html?1=$2 RewriteRule ^/clientname/(.*)/(.*)/(.*) $1.html?1=$2&2=$3 # for LIVE RewriteRule ^/(.*)/(.*) $1.html?1=$2 RewriteRule ^/(.*)/(.*)/(.*) $1.html?1=$2&2=$3 --- Any help or linkage would be great! TIA Justin French --------------------------------------------------------------------- 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