Hi, how do I redirect a 404 error to my .htaccess homepage?
Example: site.com , if you write site.com/some_site_notforund instead of 404, it redirects us to the main page
Example 2:sadistic.pl , if you write sadistic.pl/some_site_notfound instead of 404, it redirects us to the current page
Try:
FallbackResource /index.html
or whatever is on the main page
to try:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ /index.html [L]
,
.htaccess:
ErrorDocument 404 /404.php
, , 404.php.
404.php :
<?php header('location:index.php'); ?>
, , , 404.php index.php
ErrorDocument 404/index.php
. , 404 , URL,
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ http://127.0.0.1/dir/index.php [L]
.
Source: https://habr.com/ru/post/1527820/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1527815/nsis-envvarupdate-overwrites-system-path-when-path-is-too-long-is-there-a-workaround&usg=ALkJrhg6CgjPZYaPSl9nLgSQcYJ3VQhSbAMoving UISearchBar Position in Navigation Bar - iosSpeed limits infinite while loop in Python - pythonHow lazy to register Spring 'bean definitions to improve startup time? - javaHow to get a Facebook debugger to read the canonical URL? - phpWhy does the date not appear when I launch Android? - javaDisplaying records from MySQL database using JTable in Java - javaTrying to match nodes between similar graphs - algorithmcustom listview edittext не редактируется при нажатии кнопки, когда я использую descedantsfocusability = "blockdescedant" - androidCrystal Reports - select individual records in a group - crystal-reportsAll Articles