Changes

From SME Server
Jump to navigationJump to search
1,491 bytes added ,  09:08, 23 September 2010
added httpd.conf example
Line 153: Line 153:     
Examine /etc/php.ini to see that your changes have been created.
 
Examine /etc/php.ini to see that your changes have been created.
 +
 +
 +
====httpd.conf====
 +
 +
This example comes from a forum post at http://forums.contribs.org/index.php/topic,40336.0.html where a user asks how to redirect the "404 page not found rule" to a php file.
 +
 +
Make a custom template folder
 +
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
 +
 +
Edit the template fragment with vi or pico
 +
cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
 +
pico S85ErrorPages
 +
and add the following text
 +
# Add custom error pages here
 +
ErrorDocument 404 /notfound.html
 +
 +
Save & exit from vi or pico
 +
Ctrl c
 +
Ctrl x
 +
 +
Expand template & restart service
 +
expand-template /etc/httpd/conf/httpd.conf
 +
sv t /service/httpd-e-smith
 +
 +
Using your favourite html editor, create a suitable web page & save it in the Primary/html ibay (or otherwise applicable ibay) with the filename of notfound.html
 +
 +
Then open your browser and type in an incorrect URL (making sure the domain is valid) eg
 +
http://www.mydomain.com/dunno
 +
and your new error page should be displayed.
 +
 +
If custom error pages are required for virtual domains, create a new html error page for each domain and save it in the html folder of the appropriate ibay.
 +
 +
This concept can also apply to other common error document pages such as
 +
 +
400 Bad Request
 +
401 Unauthorized
 +
403 Forbidden
 +
 +
These errors can be catered for by appropriate lines in the template fragment to point to the particular pages.
 +
 +
A full list of error codes can be found at http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
     
624

edits

Navigation menu