Page 1 of 1
Relative path on Unix server?
Posted: Wed Feb 11, 2004 1:00 am
by raymedia
i was developing my php site on windows - localhost and now i have moved it to unix server. but it seems it have problem with my relative path to files.
ie.
Code: Select all
<img src="images/corner/box_r1_c1.gif" alt="test"></img>
I have tried to look for an answer throughout the internet but no success.
i realise that i might solve this by using absolute path
ie.
Code: Select all
<img src="http://www.monkey.com/images/corner/box_r1_c1.gif" alt="test"></img>
but everytime i move the file i have to change it and i feel its not a very good practise. If anyone knows how to fix this, please help me. Thank you
Posted: Wed Feb 11, 2004 3:24 am
by JayBird
on a side note for your reference <img> does NOT need a closing </img> tag.
what if you change your path to a root relative path like this
Code: Select all
<img src="/images/corner/box_r1_c1.gif" alt="test">
Mark
Posted: Wed Feb 11, 2004 3:24 am
by Wayne
is the path and file name all lower case on the server, as windows is not case sensitive whereas UNIX is, could be your problem.
Posted: Wed Feb 11, 2004 3:26 am
by malcolmboston
use css
Posted: Wed Feb 11, 2004 3:49 am
by raymedia
I have check it, but every files names are lower case. Below are some bit of the code.
Code: Select all
head>
<title>TopStar Computer International :: <?=$title ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/tci.css" type="text/css">
<SCRIPT language="javascript" src="script/javascript.js"></SCRIPT>
</head>
<body onLoad="MM_preloadImages('images/corner/box_r1_c1.gif','images/corner/box_r1_c2.gif','images/corner/box_r1_c3.gif','images/corner/box_r2_c1.gif','images/corner/box_r2_c3.gif','images/corner/box_r3_c1.gif','images/corner/box_r3_c2.gif','images/corner/box_r3_c3.gif','images/do.gif')">
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3">
<table width="800" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="300">
<h2><b>
TopStar Computer International
</b></h2>
</td>
<td width="500" align="right"><img src="images/do.gif" width="450" height="71" align="top"></td>
</tr>
</table>
</td>
</tr>
<form action="logout.php" method="post">
<tr>
<td class="blueLine" align="left"><b><?=date("D, F j, Y") ?></b></td>
<td class="blueLine"></td>
<td class="blueLine" align="right">
<input class="logoutButton" type="submit" name"action" value="Logout">
</td>
</tr>
Posted: Wed Feb 11, 2004 4:11 am
by JayBird
did you try my suggesion?
Mark
Posted: Wed Feb 11, 2004 4:52 am
by raymedia
I did but no luck..its really frustrating.
Posted: Wed Feb 11, 2004 5:14 am
by malcolmboston
well i cannot see how linux doesnt support relative paths, i have exactly the same sites on both my linux and windows box (2 seperate apache versions btw)
i copied and pasted my site from windows (so there is no changes) and every thing works fine, i would also like to point out that all my sites use document relative links so this cannot be the case
all i can think of is...........
1 - you do not have permissions to a certain folder on unix (quite likely, linux has a habit of <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>' you up in this way)
2 - your file paths are not 'cased' correctly