How can I setup dynamic/custom error pages?

If you have defined your own custom Error Pages using the “Define Error Pages” tool within the Control Panel, you may have noticed that you can only define the contents of a non-dynamic file. If you want a tighter integration to your dynamic design, then you can do this by modifying “.htaccess”. View the examples below and modify any one of them to satisfy your needs.

Examples:
ErrorDocument 401 http://www.foo.com/files/401.php
ErrorDocument 402 /files/error.php
ErrorDocument 403 http://www.foo.com/cgi-bin/script.cgi

Redirecting your Domain or any Subdirectory

By adding a “Redirect” statement, you can redirect any subdomain or your whole domain to any other file or domain in the Internet.

Each “Redirect” statement contains the “Redirect” command, the location to be redirected and the target of the redirection. You may redirect your domain to some other domain you own or you may redirect requests for e.g. “/color” to a subdirectory called “/colour”.

Enter a line like below to redirect your Domain (it will not redirect if there is a request for a specific sub-page):

Redirect /index.html http://www.foo.com

Enter a line like below to redirect a Subdirectory:
Redirect /redirectthis/index.html http://foo.com/target.html

Hint: In both cases the target must be a full URL starting with http:// even if the target of the redirection is located in your domain.

Hint: Always include “index.html” after a directory name.