Thread: mod rewrite
View Single Post

  #2 (permalink)  
Old 09-26-2004
Nisse Engstrom
 
Posts: n/a
Default Re: mod rewrite

Christian Prochaska<chris_spam@bitterfeld-online.de> wrote:
>
> i want to rewrite the folling URL
>
> /contact/bule102/smsk4/10.html
> into
> /zen/index.php?Site=contact/index.html&bule=102&smsk=4&von=10
>
> all the turorials i found wont help me.
> something like that i think:
>
> RewriteRule ^/contact/bule*/smsk*/*.html index.php?Site=contact
> index.html&bule=$1&smsk=$2&von=$3


Two errors:

1. 'e*' matches zero or more consecutive 'e' characters.
Similar for 'k*' and '/*'.

2. '$n' matches the n:th *parenthesised* group in the pattern.


Untested:

RewriteRule ^/contact/bule(.*)/smsk(.*)/(.*).html$ \
index.php?Site=contact/index.html&bule=$1&smsk=$2&von=$3

- or -

RewriteRule ^/contact/bule([^/]*)/smsk([^/]*)/([^/]*).html$ \
index.php?Site=contact/index.html&bule=$1&smsk=$2&von=$3

- or -

RewriteRule ^/contact/bule([0-9]*)/smsk([0-9]*)/([0-9]*).html$ \
index.php?Site=contact/index.html&bule=$1&smsk=$2&von=$3

- or some variation thereof.


--n