Code for 404's

jeanm

Member
A while ago I removed some pages from my site and they are still returning 404's. I've now created a personalized 404 page but what code do I use to make this happen please?

Currently I have this ISAPI _Rewrite code in operation so do I add something into this?

[ISAPI_Rewrite]
RewriteRule (.*)\.htm $1.php [I,O,RP]
RewriteRule (.*)\.html $1.php [I,O,RP]

I've searched around on the internet for a solution but I'm not understanding what I find - it's all going over my head. My site is http://www.heritageceilings.com.au

Thanks in advance...Jean
 

chrishirst

Well-Known Member
Staff member
Huh??

If the pages are not there then they will return a 404 response and if you have created a custom 404 document that will be shown instead.

The rewrite rules above redirect *.htm & *.html document extension URLs to the same document with a .php extension, so quite what that has to with 404 response I'm not sure.
 

benjamin.morgan

New Member
If you have a .htaccess file add this:

Code:
ErrorDocument 404 "/404.html"

Make sure your file is named 404.html or if it is different change the name in the line above.
 

chrishirst

Well-Known Member
Staff member
By using ISAPIRewrite the TS is telling us that the site is running on IIS on a Windows server not Apache so there is no .htaccess file.

error documents are setup in web.config.
 

jeanm

Member
I know the Rewrite rules have nothing to do with the 404 question. I put that in there so you guys would know there is no .htaccess file.

I'm presuming I put use the code as benjamin.morgan suggests but where exactly do I put it please? I thought maybe I included it in the Rewrite rules but perhpas not. I'm sorry but I'm not at all knowlegeable on this subject - as you can no doubt tell.
 
Top