Answer the question
In order to leave comments, you need to log in
How to make a 404 page?
Hello. I'm stuck, please help.
You need to make sure that at 404, the web/404.html page is shown.
Here is the current htaccess
AddDefaultCharset UTF-8
SetEnv TZ "Europe/Moscow"
ErrorDocument 404 /404.html
ErrorDocument 500 /404.html
Options All -Indexes
RewriteEngine on
#Redirect 301 /web/(.*) /$1
#RewriteCond %{THE_REQUEST} ^.*\/web\/(.*)$
#RewriteRule ^.*\/web\/(.*)$ $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(?=!yandex).*\.html\ HTTP/
RewriteRule ^(.*)\.html$ /$1 [R=301,L]
#RewriteRule ^(.*)\.html$ /$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index\.html
RewriteRule ^(.*)index.html$ /$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*)$ /web/$1 [NC,L]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ /web/404.html [L]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question