Printable Version of Topic

Click here to view this topic in its original format

Ventrino Forum for Walker Scripts _ Ventrino FAQ _ Using .htaccess To Add Your 404 Error Page

Posted by: Martyn May 8 2007, 09:54 AM

SYMPTOMS

Your control panel does not allow you to change the 404 Error to use 404.php

CAUSE

They may use a fixed 404.shtml or the Administrator may have disabled the feature.

SOLUTION

Create a file called .htaccess in your web documents root directory (your installation includes htaccess.txt which can be renamed).

Make sure it includes:-

CODE
ErrorDocument 404 /404.php


For example your .htaccess might look like this:-

CODE
##########################
#Apache Only system file
##########################
#Sets up 404
##########################
ErrorDocument 404 /404.php

##########################
# Remove the # to disable magic quotes
# (This could cause server errors if you
# do not have permission)
##########################
#php_flag magic_quotes_gpc off


You can also check these settings

SYMPTOMS

Although you have setup the Custom Errors for your web server to call 404.php none of the virtual pages, rotator URLs or link tracker URLs are working correctly and may send you to the homepage.

CAUSE

Some server configurations adding superfluous characters to the query string.

SOLUTION

Switch on the 404 Filter

BCP -->Configuration --> General Configuration --> 404 Filter --> Yes

Also check

Also check your .htaccess has not been overwritten or altered in such a way as to invalidate the ErrorDocument entry.

Posted by: sunwest May 13 2007, 01:54 PM

Martyn,

This will not work for me. I have my .htaccess set up exactly like this but it does not affect either the magic quotes or the 404 Error page function.
Can this be corrected on the server? I have a virtual dedicated server with root access. If you can tell me where this information is located on the server,
maybe I can delete it there.

Posted by: Adam May 14 2007, 12:49 PM

Hi sunwest,

If the .htaccess method doesn't work put that code into your section of the httpd.conf and restart the webserver it should work smile.gif

-Adam

Posted by: Yorkey Nov 21 2009, 12:40 PM

Newbie question sorry ...

I'm trying this to eliminate it as the cause of other problems but stuck already ...

In my direcrtory, the htaccess file is named htaccess.txt

If I change it to .htaccess I get server errors on every page of the site ttat I've checked.

Could someone confirm for me what it is meant to be named?

Thanks

Posted by: Martyn Nov 21 2009, 01:15 PM

Yes it does need to be renamed BUT the entries need to be modified to suit your hosting. If you are getting 500 Internal Server errors it is probably because of this line:-

CODE
php_flag magic_quotes_gpc off

So remove it and then see if it works. For an explanation use the google search box and you will find why this may be required.

If you still get the error then your host has probably disabled the use of .htaccess. As this is rare and likely means the host operates restrictive web access you will need to ask them for assistance and if they are not helpful or do not understand consider another host (sorry, I know that sounds dramatic but there are a lot of small hosters out there who operate like unskilled garage mechanics with a claimed propensity of knowledge in their chosen field).

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)