Cannot display image in custom 403 error document

  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

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
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1240
  • Loc: Sydney

Post 3+ Months Ago

just thinking but would a BASE URL help

along the lines of;
Code: [ Select ]
[BASEURL]/images/pic/gif;
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

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
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1240
  • Loc: Sydney

Post 3+ Months Ago

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

but yea not sure why the code is not working tho...
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

Unfortunately I am with Rogers and do not have a cPanel
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

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
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

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
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1240
  • Loc: Sydney

Post 3+ Months Ago

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
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

I am happy about this but it is a pain having to encode for every image.

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 143 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.