Have the following structure in .htaccess:
RewriteEngine On
RewriteRule ^www\/login\/?$ login/ [L,NC,R]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
ErrorDocument 404 www/errors/404.php
And the following folder structure:
/public_html
/www - Arquivos como index, editX, deleteX, updateX
/errors - Dentro tem 404.php, 500.php, 403...
I want any error you give (404) to be inside of www, or outside (in the top folder), type the person type:
1st
www.mysite.com / anything that does not exist
or
2nd
www.mysite.com/www/there is no such thing as
be redirected to errors / 404.php, and the URL would look like this, ALWAYS:
www.mysite.com/www/errors/404
How can I do this, because the way you are neither in 1 nor in the second is redirecting correctly, is simply showing a text:
www / errors / 404.php
EDIT
Fixed the error of displaying the text instead of redirecting, but it is not applying the style. The console generates these errors:
GET https://www.meusite.com.br/www/wjhbdsbn 404 (Not Found)
GET https://www.meusite.com.br/assets/css/error.min.css
GET https://www.meusite.com.br/assets/css/font-awesome.min.css
My 404.php page:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<base href="https://www.meusite.com.br/" />
<title>Metta Contabilidade</title>
<link rel="stylesheet" href="../assets/css/error.min.css" />
<link rel="stylesheet" href="../assets/css/font-awesome.min.css" />
</head>
<body>
<div class="container">
<h1>404</h1>
<p align="center">Página não encontrada!</p>
<p align="center">Indica uma dificuldade em encontrar uma página (arquivo ou diretório) especificada na barra de endereço.</p>
</div><br>
<div align="center">
<a href="javascript:history.back()">
<i class="fa fa-arrow-circle-left" aria-hidden="true"></i> Voltar
</a><br><br>
<a href="../main.php">
<i class="fa fa-arrow-circle-left" aria-hidden="true"></i> Voltar para página inicial
</a>
</div>
</body>
</html>