.htaccess rewrite rule

Discussion in 'Programming' started by shashaman, Nov 13, 2011.

  1. #1
    My url looks like this:
    
    site.com/tests/check2.php?name=digitalforum
    Code (markup):
    I wanted a clean url like this:

    site.com/tests/digitalforum
    Code (markup):

    I included this in ma .htaccess
    RewriteEngine On
    RewriteRule ^([^/]*)\.html$ /tests/check2.php?name=$1 [L]
    Code (markup):
    its not working.. i dint go wrong anywhere.. i have been trying it since 3 hrs..

    and btw.. rewrite module is loaded in the apache config on ma server side.. i have my wordpress blog running on the same host which uses some mod_rewrite rules..

    i am sure there is no problem on ma server side..

    Help me please
     
    shashaman, Nov 13, 2011 IP
  2. expertmac

    expertmac Member

    Messages:
    78
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    46
    #2
    Hey try this:

    
    RewriteEngine on
    RewriteRule ^tests/(.*)?$ tests/check2.php?name=$1
    HTML:
     
    expertmac, Nov 25, 2011 IP
  3. fortunesfromhome

    fortunesfromhome Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ensure the script is not * out - this is a commmon error -
     
    fortunesfromhome, Nov 25, 2011 IP