Mod_rewrite not working

Discussion in 'Apache' started by bkflash, Nov 6, 2006.

  1. #1
    Hello, ive been reading mod_rewrite tutorials but can't seem to get it to work, my code is below..

    Options +FollowSymlinks
     RewriteEngine on
     RewriteRule ^views/([a-z]+) http://bkflash.com/bk2/game_holder.php?game=$1 [nc]
    Code (markup):
    my url for my gamefiles is

    http://www.bkflash.com/bk2/game_holder.php?game=Curveball

    and i want it to turn out to be somthing like

    http://www.bkflash.com/bk2/views/Curveball

    whats the problem with my .htaccess file?

    Another problem is when i right click and say view background image on my page it give me this.... http://www.bkflash.com/bk2/views/background_listing.jpg why wont it just go back to the orignal image location?
     
    bkflash, Nov 6, 2006 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^bk2/views/([^.]+)$ bk2/game_holder.php?game=$1 [L]

    The browser doesn't know you're using mod_rewrite. The HTML for the images have to be the way they would be if the mod_rewrite URLs were the real URLs.
     
    Nintendo, Nov 6, 2006 IP
  3. bkflash

    bkflash Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    bkflash, Nov 6, 2006 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #4
    You DO have to edit the URLs, to link to the new URLs!!! As long as you link to the new URLs, people won't find the old URLs...unless they are indexed in search engines.
     
    Nintendo, Nov 6, 2006 IP
  5. bkflash

    bkflash Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    ok thanks, i guess this is a good way to set up mysite:confused:
     
    bkflash, Nov 6, 2006 IP