mod_rewrite - Link Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • paulseeker
    New Member
    • Nov 2007
    • 1

    mod_rewrite - Link Problem

    This is my testing...

    In main.php:
    <html>
    <head><title> </title></head>
    <body>
    <? imclude("new.ph p") ?>
    <? include("detail .php") ?>
    </body>
    </html>


    In new.php:
    <?
    echo "<a href=\"test/artist/paul\">Paul</a><br>";
    echo "<a href=\"test/teacher/kurt\">Kurt</a><br>";
    echo "<a href=\"test/racer/mike\">Mike</a><br>";
    ?>


    In detail.php:
    <?
    if(a == "artist"){
    if(b == "paul"){ echo "Yes, Paul."; }
    else if(b == "kurt"){ echo "Yes, Kurt."; }
    else if(b == "mike"){ echo "Yes, Mike."; }
    else{ echo "Nobody here."; }
    }
    else{ echo "Not artist."; }
    ?>


    In .htaccess:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^test/(.[^\/]*)/(.[^\/]*)$ main.php?a=$1&b =$2 [L]


    Now, my problem is:

    I hover to any links of the new.php, the links are shown in correct way:
    e.g. Link of Paul shown in status bar is:

    e.g. Link of Kurt shown in status bar is:

    e.g. Link of Mike shown in status bar is:


    After I click on the link:
    e.g. http://www.example.com/band/artist/paul
    And the output is correct:
    Yes, Paul.

    And I hover to the links in new.php again, the links are shown in incorrect way:
    e.g. Link of Paul shown in status bar is:
    http://www.example.com/test/artist/test/artist/paul
    e.g. Link of Kurt shown in status bar is:
    http://www.example.com/test/artist/test/teacher/kurt
    e.g. Link of Mike shown in status bar is:
    http://www.example.com/test/artist/test/racer/mike

    Any body know how to solve this problem? Thanks in advanced.
Working...