L
L
lilikon2019-09-22 10:44:24
Apache HTTP Server
lilikon, 2019-09-22 10:44:24

Error 503 when displaying images on the site, how to fix it?

Hello, there was a problem, uploaded the site to the hosting. Created one folder in which there are two sites. And configured htaccess:

RewriteEngine on

RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTP_HOST} ^sait1\.ru$ [NC]
RewriteCond %{REQUEST_URI} !^/sait1.*$ [NC]
RewriteRule ^(.*)$ /sait1/$1 [L,NS]

RewriteCond %{HTTP_HOST} ^sait2\.sait1\.ru$ [NC]
RewriteCond %{REQUEST_URI} !^/sait2.*$ [NC]
RewriteRule ^(.*)$ /sait2/$1 [L,NS]

php_value default_charset utf-8
AddType 'text/html; charset=utf-8' .html .htm .shtml

I checked it on the local computer where I created the site, everything works fine there, and on the hosting all the pictures give a 503 error when they first hit the site, if you update a couple of times everything becomes ok.
Each folder has its own htaccess (the settings are the same):
php_value default_charset utf-8
AddType 'text/html; charset=utf-8' .html .htm .shtml
Options All -ExecCGI -Indexes -Includes +FollowSymLinks -MultiViews

<IfModule mod_security.c>
  # Turn off mod_security filtering.
  # SecFilterEngine Off

  # The below probably isn't needed, but better safe than sorry.
  SecFilterScanPOST Off
</IfModule>

ErrorDocument 404 /404.php
ErrorDocument 403 /404.php

<IfModule mod_php5.c>
  php_value register_globals 0
  php_value magic_quotes_gpc 0
  php_value session.auto_start 0
  php_value safe_mode 0
</IfModule>

<IfModule sapi_apache2.c>
  php_value register_globals 0
  php_value magic_quotes_gpc 0
  php_value session.auto_start 0
  php_value safe_mode 0
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase / 

RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
RewriteRule . %1/%2 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteCond %{REQUEST_URI} ^/index$ [OR]
RewriteCond %{REQUEST_URI} ^/index[.]+(\w+)$
RewriteRule . / [R=301,L]
</IfModule>

<ifModule mod_deflate.c>
  <filesmatch "\.(js|css|html|jpg|png|gif|eot|woff|ttf|svg)$">
    SetOutputFilter DEFLATE
  </filesmatch>
</ifModule>

<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak|cache)$">
  Order Allow,Deny
  Deny from all
</FilesMatch>

<FilesMatch "\.txt$">
  Order Deny,Allow
  Deny from all
</FilesMatch>

This is what is written in the logs:
[21/Sep/2019:22:11:57 +0300] "GET /theme/images/slider/slide_shadow.png HTTP/1.0" 503 299 "https://site1.ru/theme/css/flexslider.css" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 YaBrowser/19.9.2.229 Yowser/2.5 Safari/537.36"

Can you suggest how to fix it? Or what could be causing this?
Pictures are not displayed, and those in css and those that are written directly in html
The option to split into two sites and pick up domains is not suitable, the customer said to do everything through one site (there is no other hosting, and he does not want to expand the current one)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question