Simple mod rewrite help.... WILL REP! :)

Discussion in 'Apache' started by MarcL, Feb 14, 2011.

  1. #1
    MarcL, Feb 14, 2011 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Use the following code
    RewriteEngine On
    RewriteRule ^scripts$ web.php?id=scripts [L]
    Code (markup):
     
    mwasif, Feb 14, 2011 IP
  3. MarcL

    MarcL Notable Member

    Messages:
    4,265
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    215
    #3
    scripts is a value that will be different every time, could be toys one time and scripts another..
     
    MarcL, Feb 14, 2011 IP
  4. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #4
    Then use this
    RewriteEngine On
    RewriteRule ^(*.)$ web.php?id=$1 [L]
    Code (markup):
     
    mwasif, Feb 14, 2011 IP
  5. MarcL

    MarcL Notable Member

    Messages:
    4,265
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    215
    #5
    Thanks for the help... but I get a internal server error when I upload that to the .htaccess
     
    MarcL, Feb 14, 2011 IP
  6. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #6
    Do you have mod_rewrite enable on the server?
     
    mwasif, Feb 14, 2011 IP
  7. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #7
    You may need to add the following line before RewriteEngine On
    Options +FollowSymlinks
    Code (markup):
     
    mwasif, Feb 14, 2011 IP
  8. MarcL

    MarcL Notable Member

    Messages:
    4,265
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    215
    #8
    I didnt have it enabled at first but now I do... and even with the Options +FollowSymlinks it still internal errors on me.
     
    MarcL, Feb 14, 2011 IP