Reputation: 6554
I'm not sure what it is called if it is an error 404, 301, 500 or what when someone tries to go to a non existing url pathname of the current website. This is what I have so far for my HTACCESS page, just learning this like literally on my second day of it.
# Rewrite Base
RewriteBase /
# custom 404
ErrorDocument 404 /error.php
# No visual index
IndexIgnore *
# Add www
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.hostname.com/$1 [L,R=301]
# Cache Files for 1 week
<FilesMatch ".(xml|txt|css|js)$">
Header set Cache-Control "max-age=604800, proxy-revalidate"
</FilesMatch>
Im basically trying to find out the coolest things you can do with htaccess I've always been a front end guy and now walking the park of back end dev. Any one can help me with exactly I am looking for, and which errors are for what as I've tried googling this all and the explanations were not very clear
Upvotes: 0
Views: 57
Reputation: 186
I am not quite sure what information exactly do you need, though.
The 404 message is self-explanatory - Not Found.
301 and 302 are redirects.
The 500 is an Internal Server Error. This one deserves more attention as it can be caused by numerous things. Most common causes are incorrect permissions/ownership of files, exceeding server resources, hitting limits or coding problems etc.
Using the .htaccess you can specify custom error pages and create prettier errors that can be amusing for the customers/visitors and serve them alternative content.
If you have a more specific question, I think we will be able to better help you.
Upvotes: 1