Re: [EMAIL PROTECTED] RewriteMap questions

2007-06-06 Thread Josh Trutwin
On Fri, 1 Jun 2007 15:22:19 -0400 "Joshua Slive" <[EMAIL PROTECTED]> wrote: > There are a number of ways to get around this problem. Moving to > httpd.conf is always preferable in my opinion. But you could also > try replacing your REQUEST_FILENAME test with a test against > REQUEST_URI or THE_REQ

Re: [EMAIL PROTECTED] RewriteMap questions

2007-06-01 Thread Joshua Slive
On 6/1/07, Josh Trutwin <[EMAIL PROTECTED]> wrote: On Fri, 1 Jun 2007 08:57:06 -0400 "Joshua Slive" <[EMAIL PROTECTED]> wrote: > I can't tell at all what you are trying to accomplish here. Given > you have the second set of rules, why is the first set of rules > necessary at all? If people are r

Re: [EMAIL PROTECTED] RewriteMap questions

2007-06-01 Thread Josh Trutwin
On Fri, 1 Jun 2007 08:57:06 -0400 "Joshua Slive" <[EMAIL PROTECTED]> wrote: > I can't tell at all what you are trying to accomplish here. Given > you have the second set of rules, why is the first set of rules > necessary at all? If people are redirected to the correct place, > why do you then nee

Re: [EMAIL PROTECTED] RewriteMap questions

2007-06-01 Thread Joshua Slive
On 5/31/07, Josh Trutwin <[EMAIL PROTECTED]> wrote: On Thu, 31 May 2007 13:20:03 -0400 "Joshua Slive" <[EMAIL PROTECTED]> wrote: > Yes, but I was thinking of having your script just output the > /custom/404.php directly. Hoping this is my last question - I have the following .htaccess file: Re

Re: [EMAIL PROTECTED] RewriteMap questions

2007-05-31 Thread Josh Trutwin
On Thu, 31 May 2007 13:20:03 -0400 "Joshua Slive" <[EMAIL PROTECTED]> wrote: > Yes, but I was thinking of having your script just output the > /custom/404.php directly. Hoping this is my last question - I have the following .htaccess file: RewriteEngine On # Rewrite Map for Page Rewrites Rewri

Re: [EMAIL PROTECTED] RewriteMap questions

2007-05-31 Thread Josh Trutwin
On Thu, 31 May 2007 13:20:03 -0400 "Joshua Slive" <[EMAIL PROTECTED]> wrote: > Yes, but I was thinking of having your script just output the > /custom/404.php directly. A step ahead of you, have it not check for /custom/404.php otherwise it just goes to /. Thanks for your help, I think this is w

Re: [EMAIL PROTECTED] RewriteMap questions

2007-05-31 Thread Joshua Slive
On 5/31/07, Josh Trutwin <[EMAIL PROTECTED]> wrote: On Thu, 31 May 2007 11:02:54 -0400 "Joshua Slive" <[EMAIL PROTECTED]> wrote: > On 5/31/07, Josh Trutwin <[EMAIL PROTECTED]> wrote: > > > One last problem I seem to be having is how the program returns > > NULL > > - I have this when the program

Re: [EMAIL PROTECTED] RewriteMap questions

2007-05-31 Thread Josh Trutwin
On Thu, 31 May 2007 11:02:54 -0400 "Joshua Slive" <[EMAIL PROTECTED]> wrote: > On 5/31/07, Josh Trutwin <[EMAIL PROTECTED]> wrote: > > > One last problem I seem to be having is how the program returns > > NULL > > - I have this when the program finds a match in the map file: > > > > fputs(STDOUT,

Re: [EMAIL PROTECTED] RewriteMap questions

2007-05-31 Thread Joshua Slive
On 5/31/07, Josh Trutwin <[EMAIL PROTECTED]> wrote: One last problem I seem to be having is how the program returns NULL - I have this when the program finds a match in the map file: fputs(STDOUT, $map[$uri] . "\n"); When it doesn't find a match though I have it doing this: fputs(STDOUT, "NUL

Re: [EMAIL PROTECTED] RewriteMap questions

2007-05-31 Thread Josh Trutwin
On Thu, 31 May 2007 10:06:10 -0400 "Joshua Slive" <[EMAIL PROTECTED]> wrote: > If you can get that to work under load, that's great. But I'd worry > about that program becoming a choke point. Only one request at a > time can be processed through the program. (Make sure you are using > RewriteLock

Re: [EMAIL PROTECTED] RewriteMap questions

2007-05-31 Thread Joshua Slive
On 5/31/07, Josh Trutwin <[EMAIL PROTECTED]> wrote: Here's what I'm currently doing: In httpd.conf: RewriteMap rewriter prg:/usr/local/bin/rewriter.php In vhosts .htaccess file: RewriteEngine On RewriteRule .* ${rewriter:%{REQUEST_FILENAME}^%{REQUEST_URI}} [L,QSA] I have to "pass" in the b

Re: [EMAIL PROTECTED] RewriteMap questions

2007-05-31 Thread Josh Trutwin
On Wed, 30 May 2007 22:29:53 -0400 "Joshua Slive" <[EMAIL PROTECTED]> wrote: > > Out of curiosity - how would you use the hostname in the lookup > > key? > > Adjust your db file to use host/path instead of just path as the > key, and then: > > RewriteCond ${existing:%{HTTP_HOST}$1|NOT-FOUND} =NO

Re: [EMAIL PROTECTED] RewriteMap questions

2007-05-30 Thread Joshua Slive
On 5/30/07, Josh Trutwin <[EMAIL PROTECTED]> wrote: On Wed, 30 May 2007 16:20:23 -0400 "Joshua Slive" <[EMAIL PROTECTED]> wrote: > No. The %0 notation is specific to mod_vhost_alias. It can't be used > in any other directive. (In particular, RewriteMaps are initialized > at server startup, so it

Re: [EMAIL PROTECTED] RewriteMap questions

2007-05-30 Thread Josh Trutwin
On Wed, 30 May 2007 16:20:23 -0400 "Joshua Slive" <[EMAIL PROTECTED]> wrote: > No. The %0 notation is specific to mod_vhost_alias. It can't be used > in any other directive. (In particular, RewriteMaps are initialized > at server startup, so it doesn't work to make their location a > per-request v

Re: [EMAIL PROTECTED] RewriteMap questions

2007-05-30 Thread Joshua Slive
On 5/30/07, Josh Trutwin <[EMAIL PROTECTED]> wrote: Thanks - great suggestions - now my next issue. This is all done in VirtualHosts, I noticed RewriteMap cannot be declared in a .htaccess so I put it in the VirtualHost like so: VirtualDocumentRoot /httpd/%0/html RewriteMap re

Re: [EMAIL PROTECTED] RewriteMap questions

2007-05-30 Thread Josh Trutwin
On Wed, 30 May 2007 15:06:27 -0400 "Joshua Slive" <[EMAIL PROTECTED]> wrote: > On 5/30/07, Josh Trutwin <[EMAIL PROTECTED]> wrote: > > I have been asked to create rewrite rules for sites that use an > > old page naming scheme to a new one. The first attempt was to > > create a .htaccess file that

Re: [EMAIL PROTECTED] RewriteMap questions

2007-05-30 Thread Joshua Slive
On 5/30/07, Josh Trutwin <[EMAIL PROTECTED]> wrote: I have been asked to create rewrite rules for sites that use an old page naming scheme to a new one. The first attempt was to create a .htaccess file that had a rewrite rule for every page, something like: RewriteRule ^new_page_name.php$ /site

[EMAIL PROTECTED] RewriteMap questions

2007-05-30 Thread Josh Trutwin
I have been asked to create rewrite rules for sites that use an old page naming scheme to a new one. The first attempt was to create a .htaccess file that had a rewrite rule for every page, something like: RewriteRule ^new_page_name.php$ /sitepages/pid123.php [L,QSA,NC] Works ok for small sites,