473,377 Members | 1,153 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,377 software developers and data experts.

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
0 1637

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

Similar topics

4
by: Support | last post by:
Hello, I am running RedHat & Apache. RedHat does not allow creating more that 32000 subdirectories in one folder due to #defined constant limitation in the core code. I need to display 47000...
1
by: Cosmin Chiru | last post by:
Hello, I'm using SmartyPaginate to paginate results. Thing is I'm also using mod_rewrite for the entire site and the paginate link should look like this: "/products/pages/1". How can I do that?...
4
by: Hermann.Richter | last post by:
I want to rewrite URLs like http://domain/dir/file.php?var1=val1&var2=val2#anchor to http://domain/dir/file?var1=val1&var2=val2#anchor In other words, I want to strip out the php extension ...
5
by: laredotornado | last post by:
Hi, I have verified that mod_rewrite is enabled on my Apache 2.2 instance. However, now I'm having a problem just serving pages using .htaccess files. Following Rik's advice, my .htaccess file...
2
by: Susanne West | last post by:
hi group. i'm tackling a bigger project that will use mod_rewrite to patch a series of urls into a master php-script. this script builds the page framework that contains a series of elements...
3
by: Dr. No | last post by:
I am new to using mod_rewrite and am trying to rewrite a URL to pass values to my script so that: http://www.myclient.com/everything/animals/mammals/cats is transformed into ...
7
by: k3pp0 | last post by:
Hello. I'm trying to make use of "pretty URLs" with Apache's rewrite module. Here's what I want: http://foo.bar/index.php?download should be replaced with
11
by: =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?= | last post by:
With Apache's mod_rewrite module I can keep *.php files and load them as *.html files: # Make http//example.com/foo/bar.html load /home/site/foo/bar.php RewriteEngine On RewriteRule...
7
by: Dale | last post by:
again, i know this is OT...just move along to the next post if it bugs you. :) i had been trying to have this: project.66.204.32.110 from the client browser, map to a virtual host where the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.