How to load an Error 404 page for the site and another for HTACCES application?

0

.htacess site

 # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    # Redirecionamento http to https SSL Protocol

    RewriteEngine On
    RewriteCond %{HTTPS} off 
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

    # END WordPress

    RewriteEngine On
    ErrorDocument 404 /404.html

.htacess System

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$1 [PT,L]


RewriteEngine On
ErrorDocument 404 /https://www.meusite.com.br/aplicacao/404.html
    
asked by anonymous 13.05.2018 / 00:54

1 answer

1

Both directives are wrong:

ErrorDocument 404 /http://localhost/www.meusite.com.br/404.html

E:

ErrorDocument 404 /http://localhost/aplicacao/404.html

The accepted formats are:

  • ErrorDocument 404 "Sorry, our script crashed. Oh dear" '
  • ErrorDocument 404 /errors/not_found.html
  • ErrorDocument 404 /subscription/how_to_subscribe.html
  • ErrorDocument 404 http://error.example.com/server_error.html

And in the case of the latter it will be redirected.

In your code there is a% ko of% up front, in fact it is very likely that you want to pass is the document and not a URL , then the correct one would be to pass the complete internal path, for example if in / or DocumentRoot apache is set something like VirtualHost to the first would be:

ErrorDocument 404 /www.meusite.com.br/404.html

And for the other would be:

ErrorDocument 404 /aplicacao/404.html
    
13.05.2018 / 02:51