LoginSignup
5
5

More than 5 years have passed since last update.

XOOPSでユーザ登録やログイン画面等だけSSL対応する.htaccess

Posted at

user.phpやregister.phpなどユーザ登録、ログインなどの画面だけhttpsへリダイレクトさせて、他のページへSSLアクセスされた時は逆にhttpへリダイレクトさせる.htaccessです。

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/(user|register|edituser|lostpass)\.php [OR]
RewriteCond %{REQUEST_URI} ^/modules/user/
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L]

RewriteCond %{REQUEST_URI} !(^/(user|register|edituser|lostpass)\.php)
RewriteCond %{REQUEST_URI} !(^/modules/user/)
RewriteCond %{HTTPS} on
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L]
5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5