467,075 Members | 1,110 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,075 developers. It's quick & easy.

mod_rewrite - Link Problem

This is my testing...

In main.php:
<html>
<head><title></title></head>
<body>
<? imclude("new.php") ?>
<? 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:
http://www.example.com/test/artist/paul
e.g. Link of Kurt shown in status bar is:
http://www.example.com/test/teacher/kurt
e.g. Link of Mike shown in status bar is:
http://www.example.com/test/racer/mike

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.
Nov 2 '07 #1
  • viewed: 1484
Share:

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Cosmin Chiru | last post: by
4 posts views Thread by Hermann.Richter@gmail.com | last post: by
5 posts views Thread by laredotornado@zipmail.com | last post: by
2 posts views Thread by Susanne West | last post: by
3 posts views Thread by Dr. No | last post: by
7 posts views Thread by k3pp0 | last post: by
11 posts views Thread by =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.