メインコンテンツへスキップ

設定コード自動生成ツール

常時SSL化やBasic認証、リダイレクト、キャッシュ有効化などの各種サーバー設定コードを、簡単なクリック選択だけで自動生成します。

リダイレクト設定

WWWあり・なしの統一
カスタム転送元
カスタム転送先

セキュリティと制御

サイト最適化 (高速化)

自動生成された設定コード

# -----------------------------------------------------
# Generated by ServerLens Config Generator
# -----------------------------------------------------

<IfModule mod_rewrite.c>
  RewriteEngine On

  # HTTPからHTTPSへの常時リダイレクト
  RewriteCond %{HTTPS} off
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

</IfModule>

# ディレクトリ内ファイル一覧表示の禁止
Options -Indexes

<IfModule mod_headers.c>
  # クリックジャッキング防止対策
  Header always set X-Frame-Options "SAMEORIGIN"
</IfModule>

# ブラウザキャッシュ有効化 (Expires)
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 month"
  ExpiresByType text/html "access plus 0 seconds"
  ExpiresByType text/css "access plus 1 year"
  ExpiresByType application/javascript "access plus 1 year"
  ExpiresByType image/gif "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 year"
</IfModule>

# gzipファイル圧縮転送による高速化
<IfModule mod_deflate.c>
  SetOutputFilter DEFLATE
  AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
</IfModule>
サーバー設定の次は

高速リダイレクトを処理する高性能レンタルサーバーの選定

ApacheとNginxのハイブリッド構成などで圧倒的な静的キャッシュ処理能力を誇る国内トップサーバーを比較。

サーバー構成・設定に関するFAQ

構成エラーを防止するための基本知識。