httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin French <jus...@indent.com.au>
Subject [users@httpd] help with rewrite please
Date Wed, 27 Aug 2003 02:26:09 GMT
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 <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


Mime
View raw message