You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by yc lim <me...@hotmail.com> on 2004/07/29 11:21:39 UTC
[users@httpd] Unable to relative link outside root directory
Hi,
I have an issue here, hope you guys can help.
I am not sure if it is an issue with Apache, but I am unable to link
documents (e.g. jpeg) from outside the root document.
E.g.
Document root: /var/www/html/websiteroot/
Index Document: /var/www/html/websiteroot/index.html
image folder: /var/www/html/image/
What I wish to do is to place the images in /image/ onto index.html. I
beleive if my structure is as such, I should have a img src of
"../image/1.jpeg right?
Unfortuantely, apache refuses to display the image. I have even tried the
whole path i.e. /var/www/html/image/1.jpeg. And it still refuses to display
the image.
I believe I used to be able to do it.
Can anyone help?
Thanks!
YC
_________________________________________________________________
Fast. Clear. Easy. The new MSN Search. http://search.msn.com.sg/
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Unable to relative link outside root directory
Posted by Eimantas Vaiciunas <ei...@sc.vu.lt>.
On Thursday 29 July 2004 11:21, yc lim wrote:
> Hi,
>
> I have an issue here, hope you guys can help.
>
> I am not sure if it is an issue with Apache, but I am unable to link
> documents (e.g. jpeg) from outside the root document.
It is apache issue, though it's not an issue. it's more like security feature.
> E.g.
>
> Document root: /var/www/html/websiteroot/
> Index Document: /var/www/html/websiteroot/index.html
> image folder: /var/www/html/image/
>
> What I wish to do is to place the images in /image/ onto index.html. I
> beleive if my structure is as such, I should have a img src of
> "../image/1.jpeg right?
Nope, apache won't let you view the images from another directory if proper
permissions are absent.
You should try adding Alias directive:
Alias /images/ /var/www/html/image/
Then set <Directory> directive for that directory (/var/www/html/image/)
<Directory /var/www/html/image>
Options -Indexes
Order deny allow
Allow from all
OtherDirectives Here
</Directory>
Restart apache and include all the images in html as <img src="/images/
some.jpg" alt="" />
-----
Eimis
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org