httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Blythe" <jos...@optcom.net.au>
Subject RE: [users@httpd] mod_rewrite help
Date Mon, 26 May 2003 04:10:32 GMT
No matter just worked out that I could just use the BASE tag in the header
:)

Regards,

Joseph

-----Original Message-----
From: Joseph Blythe [mailto:joseph@optcom.net.au]
Sent: Monday, 26 May 2003 12:41 PM
To: users@httpd.apache.org
Subject: [users@httpd] mod_rewrite help


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
follows:

 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
/products.php/id/13/images/optcom_logo_sml_white.gif
(3) applying pattern '^/products.php/id/([0-9]+)' to uri
'/products.php/id/13/images/optcom_logo_sml_white.gif'
(2) rewrite /products.php/id/13/images/optcom_logo_sml_white.gif ->
/products.php?id=13
(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,

Regards,

Joseph Blythe


---------------------------------------------------------------------
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


---------------------------------------------------------------------
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