Forum Moderators: phranque

Message Too Old, No Replies

URl REWRITE and Relative PATH

         

Mahabub

5:42 pm on Jun 1, 2009 (gmt 0)

10+ Year Member



Options +FollowSymlinks
RewriteEngine on
RewriteRule ^files/([^/]+)/([^/]+)/([^/]+).html$ /file.php?code=$1&time=$2&name=$3 [L]

MY url looks like

[mydomain.com...]

Its getting the content of file.php and working fine. But problem with relative path like

content of file.php is

 <a href="1.php"> Test </a> 

This link should be [mydomain.com...]

but it shows [mydomain.com...]

Sorry for bad english. How do i resolve this issue.

Thanks
Mahabub

Thanks
mahabub

[edited by: Mahabub at 5:44 pm (utc) on June 1, 2009]

g1smd

5:46 pm on Jun 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It is the browser that resolves the destination of relative URLs by stripping off the filename (everything after the final slash), and then appending your relative part on to the end of that.

Change the link to be

[b]/[/b]1.php
instead. Now it will strip all of the path off, back to the bare domain name, and then append the new data. Now it will work as you want it.