LoginSignup
0
0

More than 5 years have passed since last update.

.htaccessメモ

Last updated at Posted at 2015-03-16

該当ファイルへのアクセスをリダイレクト

RedirectMatch 301 /test http://yahoo.co.jp

UAに応じてリダイレクト

RewriteCond %{HTTP_USER_AGENT} !(iPod|iPhone|iPad|Android)
RewriteRule ^sp/(.*)$ / [R=301,L]

RewriteCond %{HTTP_USER_AGENT} (iPhone|iPod|iPad|Android) [NC]
RewriteRule ^$ /sp/ [R=301,L]

RewriteCond %{HTTP_USER_AGENT} !Twitterbot [NC]
RewriteRule ^$ /pc/ [R=301,L]

FBやmixiのクローラを許可

order deny,allow
deny from all

Allow from env=fb_crawler
Allow from env=fb_crawler2
Allow from env=mixi_crawler

basic認証

AuthUserFile /home/hogehoge/.htpasswd
AuthGroupFile /dev/null
AuthName "Please enter your ID and password”
AuthType Basic
require valid-user
0
0
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
0
0