-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
34 lines (28 loc) · 1.03 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
RewriteEngine On
# prevent directory listing
Options -Indexes
# set default index-page
DirectoryIndex index.php home.php about.php index.html maintenance.html
# IF the request filename with .php extension is a file which exists
RewriteCond %{REQUEST_FILENAME}.php -f
# AND the request is not for a directory
RewriteCond %{REQUEST_URI} !/$
# redirect to the php script with the requested filename
RewriteRule (.*) $1\.php [L]
# rewrite post to parameter
RewriteRule ^(.*)/([0-9]+-.*)$ $1/single?post=$2 [L]
# rewrite search to index
RewriteRule ^(.*)/search$ $1/index [L]
# Custom error documents
ErrorDocument 400 /400
ErrorDocument 403 /403
ErrorDocument 404 /404
ErrorDocument 500 /500
ErrorDocument 502 /502
ErrorDocument 504 /504
ErrorDocument 509 /509
# L'erreur 509 ne fonctionne pas sur un "Simple Hosting" de Gandi.
RewriteRule ^(400|403|404|500|502|504|509)$ /config?error=$1 [L]
# L'erreur 509 ne fonctionne pas sur un "Simple Hosting" de Gandi.
# Pour le faire fonctionner :
#RewriteRule ^(400|403|404|500|502|504)$ /config?error=$1 [L]