4
I’ve seen several attempts to enable error pages in apache/php but none worked here.
have file .htaccess and in it I have the following lines:
ErrorDocument 400 /index.php
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 404 /404.php
ErrorDocument 500 /500.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(index|index/)$ index.php [NC,L]
RewriteRule ^index/([a-z0-9-]+)$ index.php?pagina=$1 [NC]
</IfModule>
I tested with a missing page on localhost!
Why apache does not redirect to error pages?
Also tried so on . htaccess and did not give
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
ErrorDocument 400 /index.php
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 404 /404.php
ErrorDocument 500 /500.php
RewriteRule ^(index|index\/)$ index.php [NC,L]
RewriteRule ^index\/([a-z0-9-]+)$ index.php?pagina=$1 [NC]
</IfModule>
I’ve reestablished Apache and nothing
Setei Allowoverride para All in all httpd.conf occurrences. I removed the comment from the mod_rewrite line.
Nothingness!
You’re putting it out of the mod_rewrite tag, it’ll never work. And you’re putting it before Rewriteengine On, which means you’re not using it in rewrite mode.
– Ivan Ferrer