mod rewrite help

Discussion in 'Content Management' started by klown, Apr 9, 2007.

  1. #1
    I'm trying to setup mod rewrite for a new script. The script will run within a sub folder of a site and is similar to a blog. Currently you can access page like this:

    domain.com/script/index.php?url=index (The index page)
    domain.com/script/index.php?url=Category (The category page)
    domain.com/script/index.php?url=this-blog-entry-about-something (a blog entry)

    When the rewrite happens I want the url to display like the following

    domain.com/script/index.php (The index page)
    domain.com/script/Category.php (The category page)
    domain.com/script/this-blog-entry-about-something.php (a blog entry)

    I have tried numerous options, the latest is below but it still doesn't work.

    
    Options +FollowSymLinks
    Options +Indexes
    
    RewriteEngine On
    RewriteRule ^script/([^/]*)\.php$ /script/index.php?url=$1 [L]
    
    Code (markup):
    Any idea what I'm doing wrong?
     
    klown, Apr 9, 2007 IP
    Arnie likes this.
  2. tnd

    tnd Well-Known Member

    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    123
    #2
    May be the problem of * try to change to +

    
    RewriteRule ^script/([^/][COLOR="Red"]+[/COLOR])\.php$ /script/index.php?url=$1 [L]
    
    Code (markup):
     
    tnd, Apr 9, 2007 IP
  3. klown

    klown Peon

    Messages:
    2,093
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Its giving me "500 Internal Server Error" with that
     
    klown, Apr 10, 2007 IP
  4. tnd

    tnd Well-Known Member

    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    123
    #4
    Can you check error message on the log file? if yes please show to me
     
    tnd, Apr 10, 2007 IP
  5. abdussamad

    abdussamad Active Member

    Messages:
    543
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #5
    Try this:

    Options +FollowSymLinks
    Options +Indexes
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^script/(.*)\.php$ /script/index.php?url=$1 [nc,L]
    
    Code (markup):
     
    abdussamad, Apr 10, 2007 IP
  6. klown

    klown Peon

    Messages:
    2,093
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Nope, still getting a 500 server error.
     
    klown, Apr 10, 2007 IP