Cannot display image in custom 403 error document

  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post June 22nd, 2012, 3:39 pm

Hi All

I have a situation that is really baffling me.

I created a custom 403 error document.
In this document I use an image where I specify the location by the full URL, not a relative URL as:
Code: [ Select ]
http://www.mydomain.com/images/pic.gif

The 403 error documented is located in my Root.

I then added the following to the htaccess file:
Code: [ Select ]
ErrorDocument 403 /403.php


If I URL directly to the 403.php file, I see the image and all associated text.

However, when I test the 403 error document as it is to be used, I see all the associated text, but no image. I get the impression that it cannot be found.

I read somewhere where when used as an actual error document, the document is not really the same as a standard web page, the information is only streamed.

I googled to find an answer, and everything I found seemed to indicate I was theoritically doing everything correct?

Since I cannot see the image during actual operation, I must be doing something wrong, but do not know what it is.

Would appreciate any help on this issue.

Thanks
http://www.schembrionics.com
The Ultimate Solutions Center
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 22nd, 2012, 3:39 pm

  • Zealous
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 15, 2011
  • Posts: 1195
  • Loc: Sydney
  • Status: Offline

Post June 24th, 2012, 11:11 pm

just thinking but would a BASE URL help

along the lines of;
Code: [ Select ]
[BASEURL]/images/pic/gif;
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post June 25th, 2012, 7:27 am

I tried the base URL as follows:
Code: [ Select ]
<head>
<base href="http://www.mydomain.com/images/" />
</head>

<body>
<img src="pic.gif" />
</body>
  1. <head>
  2. <base href="http://www.mydomain.com/images/" />
  3. </head>
  4. <body>
  5. <img src="pic.gif" />
  6. </body>


It did not work. Would not display images
http://www.schembrionics.com
The Ultimate Solutions Center
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 15, 2011
  • Posts: 1195
  • Loc: Sydney
  • Status: Offline

Post June 25th, 2012, 7:46 am

just thinking, Cpanel has custom pages? Could just use cpanel for it.

but yea not sure why the code is not working tho...
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post June 25th, 2012, 7:52 am

Unfortunately I am with Rogers and do not have a cPanel
http://www.schembrionics.com
The Ultimate Solutions Center
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post June 25th, 2012, 10:06 am

I added an href URL link and it worked fine.

I would have expected the img src link to work also but it does not display.

If I paste the image URL into a browser:
Code: [ Select ]
http://www.mydomain.com/images/pic.gif

I can see the image

Any suggestions
http://www.schembrionics.com
The Ultimate Solutions Center
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post June 26th, 2012, 11:38 am

I finally was able to get my custom 403 error page to display the images.

I had to embed them into the web page using Base64 encoding.

I am still baffled as to why this is the only way I can get the images to be displayed
http://www.schembrionics.com
The Ultimate Solutions Center
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 15, 2011
  • Posts: 1195
  • Loc: Sydney
  • Status: Offline

Post July 1st, 2012, 4:23 am

wpas wrote:
I finally was able to get my custom 403 error page to display the images.

I had to embed them into the web page using Base64 encoding.

I am still baffled as to why this is the only way I can get the images to be displayed


Strange but at least you got it sorted now.
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post July 2nd, 2012, 9:31 am

I am happy about this but it is a pain having to encode for every image.
http://www.schembrionics.com
The Ultimate Solutions Center

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 237 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.