Suppose I do not have the file http://www.mydomain.com/user/10202.html ie user.php then the server gives me 404 errors by default page .... than add the following file to the .htaccess file
ErrorDocument 404 /404.html
but it redirects me to http://www.mydomain.com/404.html , while I want to stay http://mydomain.com/user/10202.html and show the 404.html file, how can I do this .. .
You can use the RewriteCond ant RewriteRule from mod_rewrite.
# If file doesn't exist, i display 404.html RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /404.html [L]
.htaccess, ( error_404.html)
ErrorDocument 404 /error_404.html RewriteRule ^error_([0-9]+).(html|php)$ error.php?error=error$1 [QSA,NC]
, , , . error.php .
Source: https://habr.com/ru/post/1747335/More articles:VisualSVN pre-commit rule - svnOffice 2007 Add-in takes a long time to download for the first time - .netОчистить файл без изменения его метки времени - linuxHow to add multiple SVN hooks - svnUsing ckEditor in selected text area in django admin forms - djangoWhy is my linux signal handler working only once - c ++Skip before creation only on a specific controller in rails - ruby-on-railsSelectively search and replace specific strings using regex - regexIPhone / iPad rotation - objective-cОбновление изображения ImageUrl в репитере - c#All Articles