0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

指定ウェブページの経由を条件に表示したい

Last updated at Posted at 2019-08-06

条件

商品説明(WordPress)表示は契約ページを経由する条件にしたい

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^https://entry\.site\.com/contract.*  <- 経由したいページ
RewriteCond %{HTTP_REFERER} !^https://faq\.site\.com.* [OR]
RewriteCond %{HTTP_REFERER} ^https://faq\.site\.com/error/  <- 終着エラーページにリダイレクト
RewriteCond %{HTTP:X-Forwarded-For} !^101.102.103.104  <- 社内IPからは制限しない
RewriteCond %{REQUEST_URI} !^/wp-login\.php.*
RewriteCond %{REQUEST_URI} !\.css$
RewriteCond %{REQUEST_URI} !\.gif$
RewriteCond %{REQUEST_URI} !\.png$
RewriteCond %{REQUEST_URI} !\.pdf$
RewriteRule .* https://entry.site.com/error/error.html [R,END]
</IfModule>

参考

緩く限定したイベントページに使える

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?