487
edits
(Moved to new category; Additional grammar and cleanup edits.) |
m (Folder to Directory.) |
||
Line 63: | Line 63: | ||
== How to create customised error documents == | == How to create customised error documents == | ||
Create a new | Create a new Directory in your root directory (www) and name it '''errors'''. This will contain all the custom error pages you wish to display. For example, '''not_found.html''' will be displayed when a page cannot be found on your web site. | ||
Now open the root .htaccess file (the one in your root | Now open the root .htaccess file (the one in your root directory www) and add the following line: | ||
'''ErrorDocument 404 /errors/not_found.html''' | '''ErrorDocument 404 /errors/not_found.html''' | ||
Save the file. The command '''ErrorDocument 404''' will forward a user to the '''<root | Save the file. The command '''ErrorDocument 404''' will forward a user to the '''<root>/errors/not_found.html''' file when ever Apache produces the error 404. | ||
'''''Note 1'':''' The files and | '''''Note 1'':''' The files and directory can be named anything you like.<br> | ||
'''''Note 2'':''' You can use a full URL (as oppose to a virtual path) to your error file; for example: <nowiki>http://yoursite.com/errors/not_found.html</nowiki> | '''''Note 2'':''' You can use a full URL (as oppose to a virtual path) to your error file; for example: <nowiki>http://yoursite.com/errors/not_found.html</nowiki> | ||
Line 98: | Line 98: | ||
|-style="background:#f9f9f9" | |-style="background:#f9f9f9" | ||
| | | | ||
# Create a new | # Create a new directory in www named '''errors'''. | ||
# In this | # In this directory create a file named '''not_found.html''' | ||
# Add the code shown on the right. | # Add the code shown on the right. | ||
# Save the file. | # Save the file. | ||
Line 119: | Line 119: | ||
|-style="background:#f9f9f9" | |-style="background:#f9f9f9" | ||
| | | | ||
# Navigate to the root | # Navigate to the root directory '''www'''. | ||
# Open the '''.htaccess''' file. | # Open the '''.htaccess''' file. | ||
# Add the command shown on the right last line. | # Add the command shown on the right last line. |