Apache rewrite rule

Discussion in 'Apache' started by apache222, Apr 29, 2013.

  1. #1
    Hello,
    I need two rules in apache to work
    RewriteRule ^([^/]*)\.html$ index.php?page=$1 [L]
    RewriteRule ^([^/]*)/([^/]*)\.html$ index.php?pnumber=$1&page=$2 [L]

    First one rule does work and /index.php?page=something redirect to /something.html

    Second rule does not work /index.php?pnumber=1&page=something need to be /1/something.html

    But when make this link i got 404 error the request url not found.

    Please can you tell me where is error, an how i can make to second rule work too?

    Thank you
     
    apache222, Apr 29, 2013 IP
  2. darkvisje

    darkvisje Well-Known Member

    Messages:
    231
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    120
    #2
    This one is working for me:

    RewriteRule ^([^/]*)/([^/]*)\.html$ /index.php?page=$1&name=$2 [L]
    Result:
    fakedomain.com/wallpaper/wallpapername.html

    If you need more let me know
     
    darkvisje, May 2, 2013 IP
    ryan_uk likes this.