[Melbourne-pm] Apache re-write help

scottp at dd.com.au scottp at dd.com.au
Sun Feb 21 22:49:26 PST 2010

Unfortunately not.

ModRewrite will only rewrite URLs, not query strings.
But it is not hard to write one that can in ModPerl.

Or... you can even write a CGI that receives "features" that returns a move.

If you need some stub I can whip one up.


----- "Jacinta Richardson" <jarich at perltraining.com.au> wrote:

> G'day folk,
> I don't have much experience with Apache, but I need to rewrite some
> URLs.  At 
> the moment I have url like:
> http://some.example.com/documents/features?title=some+title&venue=some+venue
> The problem is that all statistics for this hit, and for all other
> titles/venues 
> are all assigned to the features page (obviously).  What I would like
> to do is 
> change the code to generate something like:
> 	http://some.example.com/documents/features/some+title/some+venue
> and then Rewrite it back into the GET request so that the server still
> calls the 
> correct script (there's more than one) with the correct arguments.  It
> seems 
> intuitively correct that this will then result in hits to these pages
> being 
> counted separately.
> I think what I need is to add this to my .htaccess file
> 	RewriteEngine on
> 	RewriteRule ^features/([^/]+)/([^/])+/?$  features?title=$1&venue=$2
> [L]
> Does that seem sane?  Or have I misunderstood how this should work?
> Thanks,
> 	J
> _______________________________________________
> Melbourne-pm mailing list
> Melbourne-pm at pm.org
> http://mail.pm.org/mailman/listinfo/melbourne-pm

scottp at dd.com.au

More information about the Melbourne-pm mailing list