httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: [users@httpd] mod_proxy: CSS & JavaScript not loaded
Date Tue, 28 Apr 2009 07:53:59 GMT
John Ruffin wrote:
...
Hi.
My suggestion : first turn off the proxy html stuff and try to see what 
exactly is happening, from the browser's point of view.
Do the following, systematically :
- access one of your pages
- note the URL (in the URL bar of the browser) that was used to access 
that page (and print it here)
- next, in the browser, look at the source of the page as the browser 
got it.  What do the references to CSS and other embedded links in the 
page look like ? Print an example here.

Next, if you want to debug the problem yourself (and most similar 
problems), here is the logic to follow :

The browser works as follows :
- it obtains the current page from requesting a certain URL.  That URL 
is now, for the browser, the *current URL* where this page now being 
displayed comes from.  The browser knows nothing else (it doesn't know 
for example that the page was generated by a back-end).
- in the course of interpreting the current page, the browser sees a 
link to another item, for example a reference to a stylesheet.  The 
browser is going to try and get that item.
For that, it must first "interpret" this URL, in function of what kind 
of URL this is :
a) if it is an absolute URL, then it will just request it, without 
change (example : "http://yourhost.company.com/stylesheets/stylesheet1.css")
b) if it is an absolute URL, but without the first part (scheme, host) 
(e.g. "/stylesheets/stylesheet1.css") then the browser will use it to 
recompose a complete URL, by prefixing it with the same scheme+host from 
which it obtained the current page.  Thus if the current page came from 
the scheme+host "http://yourhost.company.com", the browser will put 
these two elements together and request the object
"http://yourhost.company.com/stylesheets/stylesheet1.css"
(yes, the same as before)
c) if it is a relative URL, like "stylesheets/stylesheet1.css") then the 
browser has to be a bit more creative.  What it will do is
- take the URI of the current page
(e.g. "http://yourhost.company.com/yourapp/index.jsp?k=par1"
- remove anything not belonging to the URI
(in this case : "?k=par1")
- remove the last element of the URI
(in this case "index.jsp")
- add instead the relative URI of the embedded item
(in this case "stylesheets/stylesheet1.css"), thus giving
"http://yourhost.company.com/yourapp/stylesheets/stylesheet1.css"
and then request that.

You have any of the cases a, b or c.
When you know which case it is, you can simulate it by entering the same 
final URL of the stylesheet, directly in the browser URL bar, and see 
what happens.  That will put you on the way to the real issue.




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


Mime
View raw message