You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Adam Weremczuk <ad...@matrixscience.com> on 2024/02/01 13:25:14 UTC

Re: [users@httpd] missing image

Hi Sherrard,

My index.html is super simple:

--------------------------------------------------

<!doctype html>

<html>

<head>

<style>
p {text-align: center;}
</style>

<title>UNAVAILABLE</title>

</head>

<body bgcolor="FFFFFF">

<center><img src="ms-logo.png" align="top"> </center>

<p style="color: red">
The Matrix Science website is currently unavailable.</br>
We apologise for the unexpected downtime.<br/>
If you require assistance, please contact <a 
href=mailto:support@matrixscience.com>support@matrixscience.com</a>.
</p>

</body>

</html>

--------------------------------------------------

Apache config file is very basic as well:

--------------------------------------------------

<VirtualHost *:80>

         ServerName holding.matrixscience.com
	ServerAdmin webmaster@localhost
         DocumentRoot /var/www/html/holding

         ErrorLog ${APACHE_LOG_DIR}/holding/error.log
         CustomLog ${APACHE_LOG_DIR}/holding/access.log combined

	<Directory /var/www/html/holding/>
                 Options Indexes FollowSymLinks
                 AllowOverride FileInfo
                 Require all granted
         </Directory>
</VirtualHost>

--------------------------------------------------

and .htaccess in root directory to handle errors:

--------------------------------------------------

ErrorDocument 400 /
ErrorDocument 401 /
ErrorDocument 402 /
ErrorDocument 403 /
ErrorDocument 404 /
ErrorDocument 405 /
ErrorDocument 406 /
ErrorDocument 407 /
ErrorDocument 408 /
ErrorDocument 409 /
ErrorDocument 410 /
ErrorDocument 411 /
ErrorDocument 412 /
ErrorDocument 413 /
ErrorDocument 414 /
ErrorDocument 415 /
ErrorDocument 416 /
ErrorDocument 417 /
ErrorDocument 422 /
ErrorDocument 423 /
ErrorDocument 424 /
ErrorDocument 426 /
ErrorDocument 428 /
ErrorDocument 429 /
ErrorDocument 431 /
ErrorDocument 451 /
ErrorDocument 500 /
ErrorDocument 501 /
ErrorDocument 502 /
ErrorDocument 503 /
ErrorDocument 504 /
ErrorDocument 505 /
ErrorDocument 506 /
ErrorDocument 507 /
ErrorDocument 508 /
ErrorDocument 510 /
ErrorDocument 511 /

--------------------------------------------------

After I replace:

img src="ms-logo.png"

with

img src="/var/www/html/holding/ms-logo.png"   (valid path)

the image doesn't even show on the home page.

Regards,
Adam


On 31/01/2024 19:53, Sherrard Burton wrote:
> 
> 
> On 1/31/24 02:26 PM, Adam Weremczuk wrote:
>>
>> I've already tried replacing relative path to the image with absolute 
>> but it made no difference.
>>
>> Any ideas?
>>
> 
> do you have a live example with the absolute path? the broken ones that 
> i looked at all had the relative paths which (understandably) doesn't work.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] missing image

Posted by Adam Weremczuk <ad...@matrixscience.com>.
Yup, all it needed was that missing slash. TA!

On 01/02/2024 13:46, Sherrard Burton wrote:
> that is not the correct form of the absolute URL. absolute URLs are 
> based at your DocumentRoot. so since your DocumentRoot is
>
> DocumentRoot /var/www/html/holding
>
> the correct absolute URL would be "/ms-logo.png"", and the resulting 
> img tag would be
>
> <img src="/ms-logo.png">
>
> HTH
>
> best,
> Sherrard 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] missing image

Posted by Sherrard Burton <sb...@allafrica.com>.
On 2/1/24 8:25 AM, Adam Weremczuk wrote:
> Hi Sherrard,
> 
> My index.html is super simple:
<snip>

sorry if i wasn't clear. i was asking if you had the version with the 
absolute path posted on your site. no matter, see the below.

> After I replace:
> 
> img src="ms-logo.png"
> 
> with
> 
> img src="/var/www/html/holding/ms-logo.png"   (valid path)
> 
> the image doesn't even show on the home page.

that is not the correct form of the absolute URL. absolute URLs are 
based at your DocumentRoot. so since your DocumentRoot is

DocumentRoot /var/www/html/holding

the correct absolute URL would be "/ms-logo.png"", and the resulting img 
tag would be

<img src="/ms-logo.png">

HTH

best,
Sherrard

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org