+ 2
404 Catching without htaccess
Can I catch a 404 without htaccess? Or can u say how wordpress catch 404 without having a htaccess file.
2 odpowiedzi
0
It's possible to do this over your apache virtualhost file.. You have to add the following line to the virtualhostfile:
"ErrorDocument 404 /error.php"
Here is an example:
<VirtualHost *:80>
DocumentRoot /var/www/my-site/
ServerName www.my-site.tld
ServerAlias my-site.tld
DirectoryIndex welcome.html
CustomLog /var/log/apache2/my-site.access.log "combined"
ErrorLog /var/log/apache2/my-site.error.log
ErrorDocument 404 /error.php
ErrorDocument 403 /error.php
ErrorDocument 500 /error.php
</VirtualHost>
0
Wordpress is having always a .htaccess file. So don't know what you need to know?