mod-rewrite Content Handling code doesn't work

Discussion in 'Apache' started by miko67, Apr 16, 2005.

  1. #1
    Why doesn't this work?

    RewriteEngine on
    RewriteBase /~quux/
    RewriteRule ^bogforingsprogram-bogforings-system\.html$ bogfoeringsprogram-bogfoerings-system.html [R]
    RewriteRule ^gratis-bogforingsprogram\.html$ gratis-bogfoeringsprogram.html [R]
    RewriteRule ^pris-paa-bogforing\.html$ pris-paa-bogfoering.html [R]

    It's been made like stated here in the "Content Handling" section in http://httpd.apache.org/docs-2.0/misc/rewriteguide.html but doesn't work at all.

    I also made a general rewrite like this:

    RewriteEngine on
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^bogholderiet\.frac\.dk
    RewriteRule ^(.*)$ http://www.bogholderiet.frac.dk/$1 [R=permanent,L]

    that works like a charm...
     
    miko67, Apr 16, 2005 IP
  2. Nicky21

    Nicky21 Guest

    Messages:
    83
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I haven't mastered mod_rewrite, but i've worked with it a little. I tried a trial and error approach and finally managed to make it work.

    You might want to try the [RE] command while testing. As fas as i can remember it will redirect the old url to the new url in the browser itself, so if a redirect works, you'll be able to see it in your browser window!
     
    Nicky21, Apr 16, 2005 IP
  3. miko67

    miko67 Well-Known Member

    Messages:
    769
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    120
    #3
    Thx, could you elaborate a little or refer me to a quality page on this topic? I don't really know what the [RE] thing stands for :p
     
    miko67, Apr 16, 2005 IP