more on .jpg

Web hosting discussion, programming, and shared and dedicated servers.
7 posts Page 1 of 1
by speakman » Mon Feb 20, 2012 4:24 pm
When I reference the site html thusly:

http://sonic.net/~speakman/mywebsite/image.html

the .jpg image DOES get displayed.

When I reference it thusly:

http://mywebsite/image.html

the .jpg image does NOT get displayed.

So there's some poison in the css someplace ... ?
by speakman » Mon Feb 20, 2012 6:52 pm
If I look at:

www.art4lifesf.com

none of the images displays.

If I look at the same site with the more explicit URL:

www.sonic.net/users/speakman/art4lifesf.com/

all the images display.

If you try this yourself, do it in this order, since after the latter step,
your browser cache will be primed with the images.
by thulsa_doom » Mon Feb 20, 2012 11:01 pm
It's how the css references its images. I didn't look through all your css files (there are several), but from

rw_common/themes/x_pos00e9_1.1_a4l/css/feature_image/header11.css

Code: Select all

#featureImage {
	background-image: url(../../images/editable_images/header11.jpg);
}
Try changing that text to

Code: Select all

#featureImage {
	background-image: url(http://art4lifesf.com/rw_common/themes/x_pos00e9_1.1_a4l/images/editable_images/header11.jpg);
}
and see if that helps.
John Fitzgerald
Sonic Technical Support
by speakman » Tue Feb 21, 2012 10:40 am
Thank you for your reply John.

I edited heade11.css as you suggested to make the reference relative to the
website address, but the banner image still does not display.

When I changed the original header11.css to reference header11.JPG instead
of header11.jpg, and copied header11.jpg to header11.JPG, the banner image
displayed. So it's seems it's the file extension, not the path, that's the issue.

This is html generated by RapidWeaver which has an option to make all file
references relative to the website address, so I've done that and reloaded the
site, but still see no images. I also tried changing the extension on my source
images from .jpg to .JPG, but RapidWeaver itself imposes the .jpg extension
when it generates the code.

This same code, and indeed several sites I've created with RapidWeaver, run
properly on another linux-based server that work with.

Thanks again John,
Tony S
by speakman » Tue Feb 21, 2012 4:25 pm
Actually, it's not just that the .jpg files are failing to display, there are other
style components missing. You can see the difference by comparing
www.art4lifesf.com with www.art4lifesf.net. The former is the original
showing the problem, the latter is a redirect to the explicit URL, and so
displays the site as it should look.
by toast0 » Tue Feb 21, 2012 7:44 pm
It looks like you have something that's preventing your images from loading when the HTTP Referer is set to http://www.art4lifesf.com/

Compare this request with a referer:

Code: Select all

$ curl -I http://www.art4lifesf.com/rw_common/themes/x_pos00e9_1.1_a4l/images/editable_images/header11.jpg -e http://www.art4lifesf.com/
HTTP/1.1 302 Found
Date: Wed, 22 Feb 2012 03:39:04 GMT
Server: Apache/1.3.41 (Unix) mod_auth_pam/1.1.1 FrontPage/5.0.2.2635 PHP/4.4.9
Location: http://www.speakman.members.sonic.net/403.html
Content-Type: text/html; charset=iso-8859-1
with this one without:

Code: Select all

$ curl -I http://www.art4lifesf.com/rw_common/themes/x_pos00e9_1.1_a4l/images/editable_images/header11.jpg
HTTP/1.1 200 OK
Date: Wed, 22 Feb 2012 03:39:09 GMT
Server: Apache/1.3.41 (Unix) mod_auth_pam/1.1.1 FrontPage/5.0.2.2635 PHP/4.4.9
Last-Modified: Tue, 21 Feb 2012 23:18:35 GMT
ETag: "1948a75-ea1d-4f44264b"
Accept-Ranges: bytes
Content-Length: 59933
Content-Type: image/jpeg
Also, your check is not specific enough:

Referer = sonic.net -> image works (which I expected)

Code: Select all

$ curl -I http://www.art4lifesf.com/rw_common/themes/x_pos00e9_1.1_a4l/images/editable_images/header11.jpg -e http://sonic.net/
HTTP/1.1 200 OK
Date: Wed, 22 Feb 2012 03:41:14 GMT
Server: Apache/1.3.41 (Unix) mod_auth_pam/1.1.1 FrontPage/5.0.2.2635 PHP/4.4.9
Last-Modified: Tue, 21 Feb 2012 23:18:35 GMT
ETag: "1948a75-ea1d-4f44264b"
Accept-Ranges: bytes
Content-Length: 59933
Content-Type: image/jpeg
Referer = sonic.net.example.org -> image also works

Code: Select all

$ curl -I http://www.art4lifesf.com/rw_common/themes/x_pos00e9_1.1_a4l/images/editable_images/header11.jpg -e http://sonic.net.example.org/
HTTP/1.1 200 OK
Date: Wed, 22 Feb 2012 03:43:10 GMT
Server: Apache/1.3.41 (Unix) mod_auth_pam/1.1.1 FrontPage/5.0.2.2635 PHP/4.4.9
Last-Modified: Tue, 21 Feb 2012 23:18:35 GMT
ETag: "1948a75-ea1d-4f44264b"
Accept-Ranges: bytes
Content-Length: 59933
Content-Type: image/jpeg
by speakman » Tue Feb 21, 2012 9:51 pm
Thank you very much for your analysis, you're exactly right.

The .htaccess file in /home/WWW_pages/speakman, includes:

SetEnvIfNoCase Referer "sonic\.net" local_ref=1
SetEnvIf Referer "^$" local_ref=1
<FilesMatch "\.(gif|jpg|png)">
Order Allow,Deny
Allow from env=local_ref
</FilesMatch>

a typical piece of prophylaxis I thought. When I moved the .htaccess file
out of the way, the site art4lifesf.com displays properly.

So it seems that the .htaccess file in the WWW home directory is being
applied hierarchically to domains in the subdirectories, and the .htaccess
file in the art4lifesf.com sub-directory is being ignored? That seems odd.

My intent was to have a .htaccess file that applied to sonic.net/~speakman,
and a separate one in /home/WWW_pages/speakman/art4lifesf.com to
apply to art4lifesf.com. But it seems the one for sonic.net/~speakman is
also being applied to art4lifesf.com. Is that the way it is supposed to work?

In any case, my problem is resolved, thanks so much again, and thanks
also for introducing me to "curl" which I'm sure I'll be able to put to
very good use in the future.

Tony S
7 posts Page 1 of 1

Who is online

In total there are 13 users online :: 0 registered, 0 hidden and 13 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 13 guests