I like to make a .htaccess file to redirect any errors I get from a web site.
I have deleted all pages from the old site. But I have no idea what pages people have bookmaked.
The new webpage and website structure is totally different … so no page is the same as the old one, not event the index document that changed from index.html to index.php.
So here is the .htaccess file I have uploaded to the server …
FEEL FREE TO COMMENT AND GIVE ME YOUR POINT OF VIEW, WHAT YOU WILL DO?
Maybe it is an overkill … but it works! Here is the file:
#404 - Not Found The requested URL was not found on this server ErrorDocument 404 http://acecrodeo.com/new/01-acec.php?lang=fra #400 - Bad Request Your browser sent a request that this server could not understand ErrorDocument 400 http://acecrodeo.com/new/01-acec.php?lang=fra #401 - Authorization Required This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required. ErrorDocument 401 http://acecrodeo.com/new/01-acec.php?lang=fra #403 - Forbidden You don't have permission to access on this server ErrorDocument 403 http://acecrodeo.com/new/01-acec.php?lang=fra #405 - Method Not Allowed The requested method GET is not allowed for the URL ErrorDocument 405 http://acecrodeo.com/new/01-acec.php?lang=fra #406 Not Acceptable ErrorDocument 406 http://acecrodeo.com/new/01-acec.php?lang=fra #409 Conflict ErrorDocument 409 http://acecrodeo.com/new/01-acec.php?lang=fra ##413 - Request Entity Too Large The requested resource does not allow request data with GET requests, or the amount of data provided in the request exceeds the capacity limit ErrorDocument 413 http://acecrodeo.com/new/01-acec.php?lang=fra #414 - Request-URI Too Large The requested URL's length exceeds the capacity limit for this server ErrorDocument 414 http://acecrodeo.com/new/01-acec.php?lang=fra ##500 - Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request ErrorDocument 500 http://acecrodeo.com/new/01-acec.php?lang=fra #501 - Method Not Implemented GET to URL not supported ErrorDocument 501 http://acecrodeo.com/new/01-acec.php?lang=fra # ------------ i am not sure the usefullness of these.. put it anyway ! #301 - Moved Permanently The document has moved URL here ErrorDocument 301 http://acecrodeo.com/new/01-acec.php?lang=fra #302 - Found The document has moved URL here ErrorDocument 302 http://acecrodeo.com/new/01-acec.php?lang=fra #303 - See Other The answer to your request is located URL here ErrorDocument 302 http://acecrodeo.com/new/01-acec.php?lang=fra #304 - Not Modified A cached copy will be used ErrorDocument 304 http://acecrodeo.com/new/01-acec.php?lang=fra #408 - Request Time-out Server timeout waiting for the HTTP request from the client ErrorDocument 408 http://acecrodeo.com/new/01-acec.php?lang=fra #410 - Gone The requested resource is no longer available on this server and there is no forwarding address. Please remove all references to this resource ErrorDocument 410 http://acecrodeo.com/new/01-acec.php?lang=fra #411 - Length Required A request of the requested method GET requires a valid Content-length ErrorDocument 411 http://acecrodeo.com/new/01-acec.php?lang=fra
what about php request
if i request aaa.php (old file) and the new file request aaa.php?lang=eng
it come up with an error… what should i do, redirect ?
You should know that absolute URLs change the original error status code to a redirect status code:
So instead of sending
404 Not Foundas answer for a not found resource, Apache will probably send a302 Temporary Redirect.What I would do is to handle the error locally with a page that says whatever you want to say to people looking for a document. Maybe something like this:
That combined with search field should give the user some answer and help for the situation they are facing.