I tried to configure my htacess for multiples reasons :

First I have my views pages in this path : **mywebsite.fr/views/contact-us.php** (for example). I want access to files in the **/views** without being in the url and without extention format; like this : **mywebsite.fr/contact-us**

I written this lines and it working very nicely :

```
<IfModule mod_rewrite.c>

Options +FollowSymlinks
RewriteEngine on
RewriteBase /

# Retirer les extensions des pages et les rendre accessibles en lecture
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.php
RewriteRule ^/?(.*)\.php$ /$1 [L,R=301]

# check to see if the request is for a PHP file:
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^/?(.*)$ /$1.php [L]

# WWW => domaine
RewriteCond %{HTTP_HOST} www.mywebsite.fr
RewriteRule (.*) http://mywebsite.fr$1 [L,R=301]

# Suppression d'un sous répertoire
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /views/$1 [QSA,L]

```

But when I try to open an unexisting page, I have a redirection in page error 500 Internal Server Error instead my 404 page custom...

Theses error pages are in this path : **mywebsite/views/errors/404.php**

And I written this lines in my htaccess file :

```
ErrorDocument  404  /views/errors/404

```

Maybe someone can say me why the page 404 are not deployed ? Thank's