.htaccessの設定
ナビゲーションに移動
検索に移動
apache2.4のアクセス設定 URL短縮、拡張子の非表示の為のwiki
.htaccessでの設定
#拡張子.htmlのURLで非表示
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
#拡張子.phpのURLで非表示
<IfModule mod_rewrite.c>
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php \
- [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
</IfModule>
Options All -Indexes
#httpでアクセスされたら、httpsで返す設定
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://「ここにドメインを入れる!!」%{REQUEST_URI} [R=301,L]