iirf beginner: rewriting rule help needed

Topics: User Forum
Nov 30, 2006 at 12:12 PM
As an beginner with iirf i need your help.

i would like rewrite the folling roule under iis 6.0/iirf:

original apache syntax:
RewriteRule ^(0-9)-(0-9)- index.php?articleid=$1&clang=$2&%{QUERYSTRING}


the incomming url is like this one:
/55-0-3--navigationsebene.html

rewrite to:
/index.php?article_id=55&clang=0

with this rule:
RewriteRule /(0-9)-(0-9)- /index.php?article_id=$1&clang=$2


an other possible incomming url is like this one:
/58--NoName.html?file=bueserwall01.jpg&gallery=0
/58-0-NoName.html?file=bueserwall01.jpg&gallery=0

rewrite to:
/index.php?article_id=58&clang=&file=bueserwall01.jpg&gallery=0
/index.php?article_id=58&clang=0&file=bueserwall01.jpg&gallery=0


can you give me your help for a rewriting rule for both cases

any help is welcome

thanks in advance!!

jochen
Coordinator
Dec 14, 2006 at 11:19 PM
This will give you a start:


  1. With this rule
  2. possible incomming url is like this one:
  3. /58--NoName.html?file=bueserwall01.jpg&gallery=0
  4. /58-0-NoName.html?file=bueserwall01.jpg&gallery=0
#
  1. rewrite to:
  2. /index.php?article_id=58&clang=&file=bueserwall01.jpg&gallery=0
  3. /index.php?article_id=58&clang=0&file=bueserwall01.jpg&gallery=0
#
#
RewriteRule ^/(0-9)-(0-9{0,1})-NoName.html\?(.) /index.php?article_id=$1&clang=$2&$3



  1. With this rule
#
  1. the incomming url is like this one:
  2. /55-0-3--navigationsebene.html
#
  1. and it is rewritten to:
  2. /index.php?article_id=55&clang=0
#
RewriteRule ^/(0-9)-(0-9)- /index.php?article_id=$1&clang=$2