httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Blythe" <>
Subject [users@httpd] mod_rewrite help
Date Mon, 26 May 2003 03:11:29 GMT
Hello everyone,

I am rather new to mod_rewrite and am having some trouble (hope this is
correct place to post), basically I am trying to rewrite a url with
arguaments which seems to be working but what is happening is all my
relative links do not work  because I just rewrote the url. Using absolute
links is out of the question in this situation so I was wondering if anyone
had some ideas ?

I am also new to regular expressions and they are not my forte believe me :)
I am trying to make my url's search engine friendly by rewriting the url as

 RewriteRule ^/products.php/id/([0-9]+) /products.php?id=$1

Which outputs to the logfile:

(2) local path result: /products.php
(2) prefixed with document_root to /home/optcom/demo/products.php
(1) go-ahead with /home/optcom/demo/products.php [OK]
(2) init rewrite engine with requested uri
(3) applying pattern '^/products.php/id/([0-9]+)' to uri
(2) rewrite /products.php/id/13/images/optcom_logo_sml_white.gif ->
(3) split uri=/products.php?id=13 -> uri=/products.php, args=id=13
(2) local path result: /products.php
(2) prefixed with document_root to /home/optcom/demo/products.php
(1) go-ahead with /home/optcom/demo/products.php [OK]

This is working fine but all images are broken they should be relative to
"images/" I have tried another rule but cant seem to figure out what to do,
any suggestions ? Is is even possible to rewrite the image paths or do I
need to exclude them in the first rules patten ?? Below is the second rule I
was tring to correct the images.

 RewriteRule ^/products.php/id/([0-9]+)/images/(.*) images/$1

Any help/guidance much appreciated,


Joseph Blythe

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message