M
M
Minusator2019-02-08 17:32:32
htaccess
Minusator, 2019-02-08 17:32:32

Why are scripts connected to 404 pages in a different directory?

Good!
On a simple html site of 5 pages, such a problem came to light, when I go to a non-existent file, for example
https://site.ru/assets/images/uploads/1/2/3/image.jpg
I get a 404 page without registration.
In console

Загрузка < script > по адресу «https://site.ru/assets/images/uploads/1/2/3/assets/js/vendor/modernizr-3.3.1.min.js» не удалась.

on 404 page scripts are connected like this
<script type="text/javascript" src="assets/js/vendor/modernizr-3.3.1.min.js"></script>

If, for example, we go to a non-existent page by url - /123, then the 404 page is returned normally.
htaccess
RewriteEngine On
RewriteBase /
ErrorDocument 404 /404.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-02-08
@Minusator

src="assets/js/vendor/modernizr-3.3.1.min.js"

Add /
src="/assets/js/vendor/modernizr-3.3.1.min.js"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question