[SLUG] .htaccess files

Ian Eade at IGM ieade at igmwebdesign.info
Wed Aug 27 02:06:01 BST 2003


> -----Original Message-----
> From: scarborough-admin at mailman.lug.org.uk 
> [mailto:scarborough-admin at mailman.lug.org.uk] On Behalf Of 
> Mark Feather
> Sent: 27 August 2003 01:35
> To: SLUG
> Subject: [SLUG] .htaccess files
> 
> 
> Hi
> 
> I have altered my Apache and FTP config files along with the 
> directory structure of my Linux box to resemble the structure 
> of the server where my Websites are hosted with great success 
> inc the use of symlinks to redirect services such as bash and perl.
> 
> This means that all my html and script content matches and 
> works perfectly on my Linux box at home and where my websites 
> are hosted eliminating the need to continuously alter shebang 
> lines in scripts and code in my html code to suite each location.
> 
> However i still have one problem left.....My .htaccess files have html
> ErrorDocuments within them to control errors.   The ErrorDocuments are
> written in html which are displayed to the visitors browser 
> complete with hyperlinks and mailto links etc
> 
> This causes problems because i need to write in full URL 
> addresses for hyperlinks which obviously fail on my local 
> machine as they do not exist.
> 
> My Linux box has no internet connection but is on a LAN so 
> that i can browse from a Windows machine for the testing of my work.
> 
> What do i need to alter to make the URL address 
http://akwe.freeshell.org point to a specific user html directory
allowing the use of scripts and SSI's etc to continue.

Mark






Here's an initial thought, when an error occurs I re-direct to a page
which then generates a suitable message, sends an email, logs the error
and makes a cup of tea. Something like this in the .htaccess file: 

ErrorDocument 400 /trap/error.pl?400
ErrorDocument 401 /trap/error.pl?401
ErrorDocument 403 /trap/error.pl?403
ErrorDocument 404 /trap/error.pl?404
ErrorDocument 500 /trap/error.pl?500

Just change your path and the error handling page and it should work.

Maybe for windows you [could|should] avoid paths and just put the error
handling page in:

ErrorDocument 400 error.pl?400
ErrorDocument 401 error.pl?401
ErrorDocument 403 error.pl?403
ErrorDocument 404 error.pl?404
ErrorDocument 500 error.pl?500

There again you may need an .htaccess and an error handling page in each
directory? Oh well it's a start.

Ian





More information about the Scarborough mailing list