please help htaccess Mod_rewrite

Discussion in 'Apache' started by webgames247, Sep 14, 2011.

  1. #1
    Hi all

    not sure why this is not working

    URL: http://www.domain.com/hello-word-1.html

    htaccess:
    RewriteRule ^([-A-Za-z0-9-]+)-([0-9]+).html?$              /browse.php?c=$1 [L]
    RewriteRule ^([-A-Za-z0-9-]+)-([0-9]+).html([0-9]+)\.html$ /browse.php?c=$1&page=$3 [L]
    Code (markup):
    any help are very appreciate
     
    webgames247, Sep 14, 2011 IP
  2. inky2k

    inky2k Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello, you want it to be working http://www.domain.com/hello-word-1.html and passing to script arguments to browse.php?c=hello-word-1 so rewrite may be
     RewriteRule ^/([A-Za-z0-9\-]+)\.html$ /browse.php?c=$1 [L] 
    Code (markup):
    but keep in mind that command will redirect everything at root of your domain to that script.
     
    Last edited: Sep 17, 2011
    inky2k, Sep 17, 2011 IP