Cant get mod_rewrite to work

Discussion in 'Apache' started by GotSkillz, Aug 4, 2008.

  1. #1
    Hi,

    I know mod rewrite works on my server because i have other scripts that use it, I am trying to add it into another script i am using.

    I am trying to get MYURL/Arcade.php?play=connect4 to display as MYURL/arcade/play/connect4.html

    Here is what is in my .htaccess file

    
    RewriteEngine on
    RewriteBase /
    RewriteRule ^arcade/([0-9]+)/(.*)\.html$ arcade.php?play=$1 [L]
    
    Code (markup):
    Any help will be greatly appreciated :)
     
    GotSkillz, Aug 4, 2008 IP
  2. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #2
    Maybe something like this:

    
    RewriteEngine on
    RewriteBase /
    RewriteRule ^arcade/play/([^/]+)\.html$ arcade.php?play=$1 [L]
    
    Code (markup):
    make sure in this case your php script is named arcade.php and not Arcade.php (note the first CAPS letter). if you are hosting on a linux server, then it's not the same if it's CAPS letter or now... just to mention that. :cool:
     
    pr0t0n, Aug 4, 2008 IP
  3. GotSkillz

    GotSkillz Active Member

    Messages:
    101
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #3
    Thanks! It works, however now I have to change all my links on the script to reflect this.
     
    GotSkillz, Aug 4, 2008 IP