[thelist] apache rewrite

Peter peter at vardus.com
Sat Aug 18 07:41:13 CDT 2001


Hi all,
I still am struggling with apache rewrite.
I've looked at the example page, and played around with it for hours, but 
it is over my head.

What I'm trying to do is simply redirect anything in a directory, i.e.
http://url.com/stories/
or
http://url.com/stories/8
or
http://url.com/stories/8/
or
http://url.com/stories/8/print

to
http://url.com/sotry.php?id=8&action=print

Seems like a common problem, but I couldn't find it in the examples, and I 
just can't get it to work.Please, any help is appreciated: links, tips, 
solutions....

What I've been messing around with is this htaccess file:

RewriteEngine  on
# don't re-write images links
RewriteRule !\.gif$ - [C]
RewriteRule !\.jpg$ - [C]
RewriteRule !\.swf$ - [C]
RewriteRule !\.png$ - [C]
RewriteRule !\.jpeg$ - [C]
# RewriteRule ^(.*) /colombia/picture.php?id=$1
# RewriteRule ^(.*)/(.*) /colombia/picture.php?id=$1
# RewriteRule ^(.*)/(.*)/(.*)/[^*]  $1.php?city=$2&section=$3
RewriteRule ^(.*)/ /colombia/picture.php?section=11&id=$1

The kinds of problems I get are that it does / doesn't work with/without a 
trailing slash, and so on.....
Thanks for any help!!!!!!!!!!!!!!!!!!!!!!! I really need this to work!!!!
Peter





More information about the thelist mailing list