質問編集履歴
1
htaccesの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -193,3 +193,147 @@
|
|
193
193
|
```
|
194
194
|
|
195
195
|
htmlだとうまく表示されるのに、PHPファイルだと表示されないという点が気になっています。
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
(2021/05/19追加)
|
200
|
+
|
201
|
+
.htaccessについてです。ドキュメントルートにあるものです。originalディレクトリの中にはありません。
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
```ここに言語を入力
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
<FilesMatch ".(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(.php)?|xtmpl|yml)(~|.sw[op]|.bak|.orig|.save)?$|^(.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer.(json|lock)|web.config)$|^#.*#$|.php(~|.sw[op]|.bak|.orig|.save)$">
|
210
|
+
|
211
|
+
<IfModule mod_authz_core.c>
|
212
|
+
|
213
|
+
Require all denied
|
214
|
+
|
215
|
+
</IfModule>
|
216
|
+
|
217
|
+
<IfModule !mod_authz_core.c>
|
218
|
+
|
219
|
+
Order allow,deny
|
220
|
+
|
221
|
+
</IfModule>
|
222
|
+
|
223
|
+
</FilesMatch>
|
224
|
+
|
225
|
+
Options -Indexes
|
226
|
+
|
227
|
+
DirectoryIndex index.php index.html index.htm
|
228
|
+
|
229
|
+
AddType image/svg+xml svg svgz
|
230
|
+
|
231
|
+
AddEncoding gzip svgz
|
232
|
+
|
233
|
+
<IfModule mod_php7.c>
|
234
|
+
|
235
|
+
php_value assert.active 0
|
236
|
+
|
237
|
+
</IfModule>
|
238
|
+
|
239
|
+
<IfModule mod_expires.c>
|
240
|
+
|
241
|
+
ExpiresActive On
|
242
|
+
|
243
|
+
ExpiresDefault A1209600
|
244
|
+
|
245
|
+
<FilesMatch .php$>
|
246
|
+
|
247
|
+
ExpiresActive Off
|
248
|
+
|
249
|
+
</FilesMatch>
|
250
|
+
|
251
|
+
</IfModule>
|
252
|
+
|
253
|
+
<IfModule !mod_rewrite.c>
|
254
|
+
|
255
|
+
FallbackResource /index.php
|
256
|
+
|
257
|
+
</IfModule>
|
258
|
+
|
259
|
+
<IfModule mod_rewrite.c>
|
260
|
+
|
261
|
+
RewriteEngine on
|
262
|
+
|
263
|
+
RewriteRule ^ - [E=protossl]
|
264
|
+
|
265
|
+
RewriteCond %{HTTPS} on
|
266
|
+
|
267
|
+
RewriteRule ^ - [E=protossl:s]
|
268
|
+
|
269
|
+
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
270
|
+
|
271
|
+
RewriteRule "/.|^.(?!well-known/)" - [F]
|
272
|
+
|
273
|
+
RewriteCond %{REQUEST_URI} ^(.*)?/(install.php) [OR]
|
274
|
+
|
275
|
+
RewriteCond %{REQUEST_URI} ^(.*)?/(rebuild.php)
|
276
|
+
|
277
|
+
RewriteCond %{REQUEST_URI} !core
|
278
|
+
|
279
|
+
RewriteRule ^ %1/core/%2 [L,QSA,R=301]
|
280
|
+
|
281
|
+
RewriteRule ^core/install.php core/install.php?rewrite=ok [QSA,L]
|
282
|
+
|
283
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
284
|
+
|
285
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
286
|
+
|
287
|
+
RewriteCond %{REQUEST_URI} !=/favicon.ico
|
288
|
+
|
289
|
+
RewriteRule ^ index.php [L]
|
290
|
+
|
291
|
+
RewriteCond %{REQUEST_URI} !/core/[^/]*.php$
|
292
|
+
|
293
|
+
RewriteCond %{REQUEST_URI} !/core/modules/system/tests/https?.php
|
294
|
+
|
295
|
+
RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics.php$
|
296
|
+
|
297
|
+
RewriteRule "^(.+/.*|autoload).php($|/)" - [F]
|
298
|
+
|
299
|
+
<IfModule mod_headers.c>
|
300
|
+
|
301
|
+
RewriteCond %{HTTP:Accept-encoding} gzip
|
302
|
+
|
303
|
+
RewriteCond %{REQUEST_FILENAME}.gz -s
|
304
|
+
|
305
|
+
RewriteRule ^(.*).css $1.css.gz [QSA]
|
306
|
+
|
307
|
+
RewriteCond %{HTTP:Accept-encoding} gzip
|
308
|
+
|
309
|
+
RewriteCond %{REQUEST_FILENAME}.gz -s
|
310
|
+
|
311
|
+
RewriteRule ^(.*).js $1.js.gz [QSA]
|
312
|
+
|
313
|
+
RewriteRule .css.gz$ - [T=text/css,E=no-gzip:1,E=no-brotli:1]
|
314
|
+
|
315
|
+
RewriteRule .js.gz$ - [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
|
316
|
+
|
317
|
+
<FilesMatch "(.js.gz|.css.gz)$">
|
318
|
+
|
319
|
+
Header set Content-Encoding gzip
|
320
|
+
|
321
|
+
Header append Vary Accept-Encoding
|
322
|
+
|
323
|
+
</FilesMatch>
|
324
|
+
|
325
|
+
</IfModule>
|
326
|
+
|
327
|
+
</IfModule>
|
328
|
+
|
329
|
+
<IfModule mod_headers.c>
|
330
|
+
|
331
|
+
Header always set X-Content-Type-Options nosniff
|
332
|
+
|
333
|
+
RequestHeader unset Proxy
|
334
|
+
|
335
|
+
</IfModule>
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
```
|