IPB

Welcome Guest ( Log In | Register )

Using .htaccess To Add Your 404 Error Page, For Apache Web Servers Only
Martyn
post May 8 2007, 09:54 AM
Post #1


WSF Commander
*******

Group: Admin
Posts: 4,662
Joined: 26-August 05
Member No.: 10



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.
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
Martyn
post Nov 21 2009, 01:15 PM
Post #2


WSF Commander
*******

Group: Admin
Posts: 4,662
Joined: 26-August 05
Member No.: 10



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).
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 29th March 2024 - 09:00 AM