# Adding ErrorDocument rule to .htaccess file

**URL:** <https://forums.realmacsoftware.com/t/adding-errordocument-rule-to-htaccess-file/38628>\
**Category:** RapidWeaver Classic\
**Created:** [April 7, 2021, 7:55pm UTC](https://forums.realmacsoftware.com/t/adding-errordocument-rule-to-htaccess-file/38628 "2021-04-07T19:55:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigbear](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@craigbear](https://forums.realmacsoftware.com/u/craigbear)\
**Post date:** [April 7, 2021, 7:55pm UTC](https://forums.realmacsoftware.com/t/adding-errordocument-rule-to-htaccess-file/38628/1 "2021-04-07T19:55:32Z")

</div>

Trying to set up a customized 404 Page Not Found to my site. Within RapidWeaver I see this message –– Notice: You must add an ErrorDocument rule to your .htaccess file.

Could anyone give me some insight into what must be added to the .htaccess file to allow me to have a custom 404 page?

An example is given:  
ErrorDocument 404 /dev.healthcareconnects.ca/not\_found/  
\<FilesMatch “.(bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$”\>  
ErrorDocument 404 /resources/404.jpg

Dazed and confused…  
Craig

---

<div class="post-metadata">

**Author:** ![teefers](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/teefers/32/8173_2.png) [@teefers](https://forums.realmacsoftware.com/u/teefers)\
**Post date:** [April 7, 2021, 8:55pm UTC](https://forums.realmacsoftware.com/t/adding-errordocument-rule-to-htaccess-file/38628/2 "2021-04-07T20:55:05Z")

</div>

Could you give us a URL to the error page?

If you called the page `404.html` in the page inspector and left the folder name to be root `/` then the htaccess rule would look like this:

```auto
ErrorDocument 404 /404.html

```

If you used a folder name of then you need to add that to the path.

---

<div class="post-metadata">

**Author:** ![craigbear](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@craigbear](https://forums.realmacsoftware.com/u/craigbear)\
**Post date:** [April 8, 2021, 3:48pm UTC](https://forums.realmacsoftware.com/t/adding-errordocument-rule-to-htaccess-file/38628/3 "2021-04-08T15:48:13Z")

</div>

Doug;

Thanks so much for your response. To confirm my understanding then:

1. URL to the error page: dev.healthcareconnects.ca/not-found

2. If you called the page 404.html: the Filename is actually index.php The Folder is: not-found

3. So, would this be the correct .htaccess form then?: ErrorDocument 404/404.php/not-found

I haven’t tackled changes to the .htaccess file yet. I wanted to understand this part first.

Thanks in advance.  
Craig

---

<div class="post-metadata">

**Author:** ![craigbear](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@craigbear](https://forums.realmacsoftware.com/u/craigbear)\
**Post date:** [April 8, 2021, 4:08pm UTC](https://forums.realmacsoftware.com/t/adding-errordocument-rule-to-htaccess-file/38628/4 "2021-04-08T16:08:40Z")

</div>

Actually, I think maybe this might be closer for the .htaccess file?

ErrorDocument 404 /dev.healthcareconnects.ca/not-found/

Cheers,  
Craig

---

<div class="post-metadata">

**Author:** ![teefers](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/teefers/32/8173_2.png) [@teefers](https://forums.realmacsoftware.com/u/teefers)\
**Post date:** [April 8, 2021, 7:00pm UTC](https://forums.realmacsoftware.com/t/adding-errordocument-rule-to-htaccess-file/38628/5 "2021-04-08T19:00:43Z")

</div>

Okay,  
The page you are showing is in a subdomain of `dev` is that a development (playground)?  
For the error document directive to work it should to be a fully qualified URL (with protocol `https: //`) and filename (`index.html` or `index.php`). Or it can be a relative address (relative to the domain)

```auto

#Error 404
ErrorDocument 404 https://dev.healthcareconnects.ca/not-found/index.php

```

---

<div class="post-metadata">

**Author:** ![craigbear](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@craigbear](https://forums.realmacsoftware.com/u/craigbear)\
**Post date:** [April 8, 2021, 7:36pm UTC](https://forums.realmacsoftware.com/t/adding-errordocument-rule-to-htaccess-file/38628/6 "2021-04-08T19:36:40Z")

</div>

That did it Doug. Thank you so much.

Cheers,  
Craig

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/system/32/25301_2.png) [@system](https://forums.realmacsoftware.com/u/system)\
**Post date:** [May 9, 2021, 5:36am UTC](https://forums.realmacsoftware.com/t/adding-errordocument-rule-to-htaccess-file/38628/7 "2021-05-09T05:36:46Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
