I'm developing a website on my localhost. I have a problem with urls.
for a url like this
http://localhost:81/my_website/library
I should output image src this way :
<img src="<?php print $directory; ?>/image/header/headerR.png"/>
but when the above url is changed to this
http://localhost:81/my_website/library/
I should output image src this way :
<img src="../<?php print $directory; ?>/image/header/headerR.png"/>
I mean it should refer to the parent. my website has also contextual filter which must be inserted after library/ .is there any general solution for handling such thing?
$base_url = 'http://www.example.com'
in settings.php and change thewww.example.com
by your domain. It should be like$base_url = 'http://localhost:81/my_website';
in your settings.php file – Stone Vo Oct 3 '13 at 7:05