You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Dan McDonald <mu...@yahoo.com> on 2007/04/02 19:49:56 UTC

[users@httpd] relative links get broken when adding vhost

Hi,

I work at a large University and im stuck on this
apache problem. Its best explained with an example:

I have a website at
www.domain.edu/dept/sci/bio/frogs/green/poison and the
index.html file has links like ../../frogs/eyes.gif 
/style/style.css ../../../images/icon.jpg and
images/wart.jpg

User wants biofrogs.domain.edu subdomain, and would
like it pointed to the
/dept/sci/bio/frogs/green/poison directory. A
VirtualHost entry makes that the new top level
directory. 

Now there's problems.
biofrogs.domain.edu/style/style.css and
www.domain.edu/style/style.css are pointing to
completely different files. ../../../images/icon.jpg
wouldnt even be accessible on the subdomain unless you
use a absolute link etc etc. Because the DocumentRoot
changed obviously all these relative links are broken.


Is there a way to fix this other than writing the
html, or making symlinks in the new DocRoot? I really
wanted mod_rewrite to match a "../../file" request,
but it just matches the file it points to. 

Any ideas would be great! 

Thanks
Dan


 
____________________________________________________________________________________
We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 

---------------------------------------------------------------------
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] how can i filter fromout a list

Posted by Joshua Slive <jo...@slive.ca>.
On 4/3/07, herauthon <he...@home.nl> wrote:
> Dear Enlisted Ones.
>
> I would be pleased if i could exclude
> visitors because they have no return dns.
> my very smart idea was to list allthose
> without and make this a rule set for
> exclusion - but i am sure there is
> yet smarter way..
>
> enlighten me please..
> show me the way

This is a silly (if I weren't so polite, I'd say "stupid") idea. It
will slow your server and won't increase security in any noticeable
way. But if you insist,

HostNameLookups On
SetEnvIf Remote_Host ^[0-9.]+$ noname
<Location />
Order deny,allow
Deny from env=noname
</Location>

Joshua.

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


[users@httpd] how can i filter fromout a list

Posted by herauthon <he...@home.nl>.
Dear Enlisted Ones.

I would be pleased if i could exclude 
visitors because they have no return dns.
my very smart idea was to list allthose
without and make this a rule set for
exclusion - but i am sure there is 
yet smarter way..

enlighten me please..
show me the way

one apprentice alchemist 


---------------------------------------------------------------------
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] relative links get broken when adding vhost

Posted by Joshua Slive <jo...@slive.ca>.
On 4/2/07, Dan McDonald <mu...@yahoo.com> wrote:

> Now there's problems.
> biofrogs.domain.edu/style/style.css and
> www.domain.edu/style/style.css are pointing to
> completely different files. ../../../images/icon.jpg
> wouldnt even be accessible on the subdomain unless you
> use a absolute link etc etc. Because the DocumentRoot
> changed obviously all these relative links are broken.
>
>
> Is there a way to fix this other than writing the
> html, or making symlinks in the new DocRoot? I really
> wanted mod_rewrite to match a "../../file" request,
> but it just matches the file it points to.
>
> Any ideas would be great!

Apache never sees a request for a "../../file", because relative links
are resolved at the client before a request is made.

mod_proxy_html or mod_line_edit could probably be configured to do
live fix-ups on the html pages, at the expense of some additional
complexity. But a better idea is just to fix your html.

Joshua.

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