link redirection with .htaccess

Discussion in 'Apache' started by sp360, May 17, 2008.

  1. #1
    Hi all,
    I'm trying make my links more SEO friendly. What I need to do is turn my links from sitename.com/file.php?id=12345 to sitename.com/enjoy/12345
    I tried this code but i get a "Access forbidden!" error.
    RewriteEngine on
    RewriteRule .* - [F]
    RewriteRule ^enjoy/([0-9]+)/?$ file.php?$id=$1 [L]
    Code (markup):
    please help me out and tell me where im doing something wrong. Also, do I need to put any code in my php file?
    Thanks, SP360
     
    sp360, May 17, 2008 IP
  2. hostrs.com

    hostrs.com Peon

    Messages:
    157
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Interesting. I wonder why you have an error...
     
    hostrs.com, Jul 12, 2008 IP
  3. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #3
    php?$id=$1

    here's your problem.
    You should probably use this instead php?id=$1
     
    pr0t0n, Jul 13, 2008 IP