|
Posted by Rik Wasmus on November 9, 2007, 8:57 am
Please log in for more thread options
=
wrote:
> How are browsers supposed to calculate the base URL of a resource
> after a redirect?
> The browser sends a request to
>
> http://www.example.org/dir/index.html
>
> and this results in a redirect to
>
> http://www.example.org/newdir/index.html
>
> the HTML served by index.html contains a CSS reference like this
>
> <link href=3D"styles.css" rel=3D"stylesheet" type=3D"text/css"
> media=3D"screen" >
>
> Under which URL is the browser supposed to fetch the stylesheet?
> (a) http://www.example.org/dir/styles.css
> or
> (b) http://www.example.org/newdir/styles.css
(b), always, unless it's an internal redirect on the webserver and the =
browser still thinks it's looking at http://www.example.org/dir/styles.c= ss.
> Does it make a difference if the redirect is a temporary redirect vs a=
> permanent redirect?
No.
If the stylesheet url must stay the same, use this: ' =
href=3D"/path/to/style.css"'.
-- =
Rik Wasmus
|