-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtaccess.txt
171 lines (127 loc) · 5.46 KB
/
htaccess.txt
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
##############################################################
# Fichier .htaccess SPIP v 2.0 #
# #
# Permet de controler les URLs et la version de php utilisee #
# Compatible avec les URLs 'html', 'propres' et 'propres2' #
# Permet aussi d'effectuer la transition de .PHP 3 vers .PHP #
# #
# Pour utiliser ce fichier renommez-le '.htaccess' dans le #
# repertoire racine du site, en veillant a ne pas ecraser un #
# .htaccess personnalise qui s'y trouverait deja #
# #
# Attention certains hebergeurs desactivent tout ou partie #
# des fonctions du fichier .htaccess ; celui-ci est donc #
# indicatif - en cas de difficulte voir sur les forums SPIP #
##############################################################
RewriteEngine On
################ CONFIGURATION ######################
### Configuration sous-repertoire
# Chez la plupart des hebergeurs il faut indiquer "RewriteBase /"
# sinon modifiez cette ligne
RewriteBase /
# SPIP version 'php' - si vous avez d'anciennes adresses en '.php[3]',
# supprimez le '#' sur les lignes qui suivent pour rediriger les acces
# errones vers le .php correspondant
#RewriteCond %{REQUEST_FILENAME} -f
#RewriteRule ^(.+)\.php[3]$ $1.php [QSA,L]
# Fin version
###
################ REGLAGES PERSONNALISES ######################
# Inscrivez ci-dessous vos reglages supplementaires
RewriteRule \bsites/[^/]+/(IMG|local)/(.+)$ $1/$2 [R=301,skip=100]
RedirectMatch seeother ^/carto/(.*)$ http://carto.droitauvelo.org
RedirectMatch seeother ^/forum/(.*)$ http://forum.droitauvelo.org/$1
RedirectMatch seeother ^/DOC/(.*)$ http://fichiers.droitauvelo.org/DOC/$1
RedirectMatch seeother ^/MINUTOVELO/(.*)$ http://fichiers.droitauvelo.org/MINUTOVELO/$1
RedirectMatch seeother ^/HEUROVELO/(.*)$ http://fichiers.droitauvelo.org/HEUROVELO/$1
RedirectMatch seeother ^/MAQUETTES/(.*)$ http://fichiers.droitauvelo.org/MAQUETTES/$1
################ GESTIONS DES URLS SPIP #######################
# Deux pseudo-actions a present evacuees
# N'y at-il pas moyen de REMPLACER un nom dans la QueryString ?
RewriteCond %{QUERY_STRING} action=rss
RewriteRule spip.php spip.php?page=rss [QSA,L]
RewriteCond %{QUERY_STRING} action=ical
RewriteRule spip.php spip.php?page=ical_prive [QSA,L]
###
# Si le fichier ou repertoire demande existe
# ignorer toutes les regles qui suivent
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule "." - [skip=100]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule "." - [skip=100]
#
###
###
# Compatibilite avec les URLS "html" (pour transition sympa)
# voir fichier ecrire/urls/html.php
RewriteRule ^rubrique([0-9]+)(\.html)?$ spip.php?page=rubrique&id_rubrique=$1 [QSA,L]
RewriteRule ^article([0-9]+)(\.html)?$ spip.php?page=article&id_article=$1 [QSA,L]
RewriteRule ^breve([0-9]+)(\.html)?$ spip.php?page=breve&id_breve=$1 [QSA,L]
RewriteRule ^mot([0-9]+)(\.html)?$ spip.php?page=mot&id_mot=$1 [QSA,L]
RewriteRule ^auteur([0-9]+)(\.html)?$ spip.php?page=auteur&id_auteur=$1 [QSA,L]
RewriteRule ^site([0-9]+)(\.html)?$ spip.php?page=site&id_syndic=$1 [QSA,L]
# Compatibilite avec les anciennes URLS appelant directement des fichiers php
RewriteRule ^(rubrique|article|breve|mot|auteur|site|agenda|backend|backend-breves|distrib|forum|ical|plan|recherche|sommaire|sommaire_texte)\.php3?$ spip.php?page=$1 [QSA,L]
RewriteRule ^resume.php[3]? spip.php?page=sommaire [QSA,L]
RewriteRule ^page.php[3]? spip.php [QSA,L]
RewriteRule ^spip_cal\.php3?$ spip.php?page=ical_prive [QSA,L]
RewriteRule ^spip_rss\.php3?$ spip.php?page=rss [QSA,L]
# Fin compatibilite
###
###
# ping http://site/1234 => article1234
RewriteRule ^([1-9][0-9]*)$ spip.php?action=redirect&type=article&status=301&id=$1 [QSA,L]
#
###
###
# APIs
# http://site/xmlrpc.api
# http://site/atom.api/articles/1234
RewriteRule ^([\w]+)\.api(/(.*))?$ spip.php?action=api_$1&arg=$3 [QSA,L]
# Fin des APIs
###
###
# Adaptive Images
RewriteRule \badapt-img/(\d+/\d\dx/.*)$ spip.php?action=adapt_img&arg=$1 [QSA,L]
# Fin des Adaptive Images
###
###
# URLs "propres", "propres2", "libres", "arbo"
RewriteRule ^[^\.]+(\.html)?$ spip.php [QSA,E=url_propre:$0,L]
# Fin URLs "propres" et "propres2"
###
###
# Divers
# bloquer les acces aux repertoires .svn/ (SPIP, plugins, squelettes...)
RewriteRule ^(.*/)?\.svn/ - [F]
###
# Fichiers "standards" (si absents de la racine)
#
RewriteRule ^robots[.]txt$ spip.php?page=robots.txt [QSA,L]
RewriteRule ^favicon[.]ico$ spip.php?page=favicon.ico [QSA,L]
RewriteRule ^sitemap[.]xml$ spip.php?page=sitemap.xml [QSA,L]
##
# expirer les images (pour contourner gros bug MSIE sur le cache)
# note : a decommenter si vous voulez tester
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/gif A3600
ExpiresByType image/jpeg A3600
ExpiresByType image/png A3600
ExpiresByType image/x-icon A86400
ExpiresByType application/x-javascript A86400
ExpiresByType application/javascript A86400
ExpiresByType text/css A86400
<FilesMatch "\.(ttf|otf|eot|svg|woff)$" >
ExpiresDefault A86400
</FilesMatch>
<FilesMatch "prive/themes/[^/]+/images/.+\.(png|gif|jpg)$" >
ExpiresDefault A86400
</FilesMatch>
</IfModule>
#################################
# gestion des erreurs 404
# voir http://www.spip.net/fr_article3226.html
# Pour que le serveur http renvoie les erreurs 404 vers SPIP, supprimer le '#'
# ErrorDocument 404 /spip.php?page=404
#