RewriteMap behaving strange

Oh, the strange things mod_rewrite does!

RewriteMap behaving strange

Postby theslinky » Thu Mar 12, 2009 12:40 pm

I recently setup an external program to handle my URL rewrites. The program itself works pretty well, and so do the rewrite directives in apache. The problem is that I recently made changes to my external program. I know I have to restart apache for this to take effect, and so I did. Apache now seems to have reloaded my external program and everything works fine... until, about 12-24 hours later, it seems to use the old version of my program again! It's as if the old version is stuck in some sort of cache or memory. Is this a known issue or bug? Here are some details:

Apache:
Server version: Apache/2.0.52
Server built: Oct 29 2008 09:20:05
(I'm using the redhat enterprise 3 approved package).

The mod_rewrite directives:

under httpd.conf:
RewriteMap urlrewriter prg:/xxxxxx/scripts/urlrewriter.php

under .htaccess in the web directory:
RewriteEngine On
RewriteRule ^([A-Za-z0-9_-]+).html$ ${urlrewriter:$0}


The external program is written in PHP, and the first line calls /usr/bin/php. Again I'm using the redhat package for php:

PHP 5.2.9 (cli) (built: Feb 27 2009 14:38:59)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies



Again, the program isn't with processing my code and giving out URLs. The problem seems to be that when I update the external program and restart apache, apache seems to run the update code for a while, but then for some reason reverts back to code before my update... even though I'm just overwriting the external program file... It's as if it the old code is stuck in memory or something.

Can someone please advise?

Thanks,
Sridhar
theslinky
 
Posts: 2
Joined: Thu Mar 12, 2009 12:27 pm

Postby richardk » Thu Mar 12, 2009 3:13 pm

I have not heard of this problem before. You might want to submit a bug report. (Other RewriteMap bugs.)

Have you tried restarting the whole server (possibly not an option)?
Have you tried renaming the file instead of overwriting it?
Have you tried renaming the RewriteMap MapName?

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^([-a-z0-9_]+)\.html$ ${urlrewriter:$0} [NC,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby theslinky » Thu Mar 12, 2009 3:26 pm

I have tried renaming the file AND renaming the map, but neither worked.

-sridhar
theslinky
 
Posts: 2
Joined: Thu Mar 12, 2009 12:27 pm

Postby richardk » Fri Mar 13, 2009 5:20 am

Then you will need to file a bug report.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Idiosyncrasies

Who is online

Users browsing this forum: Google [Bot] and 4 guests

cron