Am i doing any mistake on URL rewriting?

Discussion in 'Apache' started by kks_krishna, Nov 1, 2007.

  1. #1
    HI, Here is my rules:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^([a-zA-Z0-9]*)/$ author.php?author=$1 [L,NC]

    the requirement is i have the url like this:
    www.sitename.com/authors/author.php?author='AuthorName'

    I want the url like this:

    www.sitename.com/authors/AuthorName

    Is there any mistake on the above rules. I have the .htaccess in the same directory.
     
    kks_krishna, Nov 1, 2007 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^authors/([^.]+)\.html$ authors/author.php?author=$1 [L]

    if you don't have .html, it'll just kill the script.
     
    Nintendo, Nov 1, 2007 IP