Ubuntu 12.04 LTSにWordPress 3.5.1がインストールされています。 Apache 2.2.22を実行しています。
注:作業中のドメインを共有できず、設定ファイルをサンテートする必要があります。ウェブサイトは公開されていますが、クライアントに関連して取り組んでいる問題は公開できません。
ドメインには、HTTP用とHTTPS用の2つの仮想ホストがあり、両方とも同じドキュメントルートを共有します。 <directory>
ファイルではなく、各vhostの.hataccess
ディレクティブにルールを書き直しました(好みだけですが、.htaccess
ファイルを使用すると同じ動作が見られます)。
/order/
ページへのすべてのアクセスをHTTPS経由で行いたい。他のすべてのURLはHTTP経由でのみ配信されるようにします。どうして?サイトにはソーシャルメディアボタンと外部ライブラリが散らばっているため、その一部はHTTPS経由ではありません。状況は次のとおりです。
/order/
以外のURLをクリックしたこれまでのところ、人々をHTTPS注文ページにリダイレクトするように構成されたHTTP vhostがあります。
<Directory /var/www/mysite.com/htdocs>
# Rewrite Rules
RewriteEngine On
# Rewrite access to order page over to HTTPS
RewriteCond %{HTTPS} =off
RewriteRule ^order/$ https://%{HTTP_Host}%{REQUEST_URI} [R=301,L]
# Wordpress Magicks Below
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</Directory>
上記のHTTP vhostのディレクティブが設定されている場合、/order/
ページにアクセスした後のすべてのブラウズがHTTPSであることを除いて、問題なく動作します(どこでも安全でない警告です!)。
ただし、HTTPSからHTTPに/order/
以外のリンクを記述しようとすると、失敗します。 SSL対応のvhostの<Directory>
ディレクティブには、次のルールセットがあります。
# SSL vhost:
<Directory /var/www/mysite.com/htdocs>
# Rewrite Rules
RewriteEngine On
# Remove HTTPS from non /order/ URLs
RewriteCond %{HTTPS} =on
RewriteCond %{REQUEST_URI} !^order/$
RewriteRule (.*) http://%{HTTP_Host}%{REQUEST_URI} [R=301,L]
# Wordpress Magicks Below
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</Directory>
ただし、/order/
ページ自体へのアクセスは、HTTPまたはHTTPSを問わず、リダイレクトループになります。勇気づけられるのは、HTTPS経由で/order/
以外のページへの着信リンクがhttp://に相当するものにリダイレクトされることです。
私はまだmod_rewriteロジックで幼虫の段階にいますが、私の試みでエラーを見つけることができないようです。誰かが私が間違っていることを見つけるのを助けることができますか?
両方の仮想ホストに対してRewriteLogLevel 9
をオンにしましたが、これはさまざまな状況で見られるものです。
非/order/
ページへの着信HTTPS URLは、SSL vhostのRewriteLog
に従って正常に機能します。
68.231.66.6 - - [06/Jun/2013:15:02:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213c0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] applying pattern '.*' to uri ''
68.231.66.6 - - [06/Jun/2013:15:02:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213c0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='on' pattern='=on' => matched
68.231.66.6 - - [06/Jun/2013:15:02:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213c0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='/' pattern='!^order' => matched
68.231.66.6 - - [06/Jun/2013:15:02:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213c0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] rewrite '' -> 'http://mysite.com/'
68.231.66.6 - - [06/Jun/2013:15:02:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213c0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] explicitly forcing redirect with http://mysite.com/
68.231.66.6 - - [06/Jun/2013:15:02:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213c0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] escaping http://mysite.com/ for redirect
68.231.66.6 - - [06/Jun/2013:15:02:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213c0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] redirect to http://mysite.com/ [REDIRECT/301]
サイトのHTTPソースURLから/order/
ページまでは機能せず、リダイレクトループが発生します-HTTP vhostのRewriteLog
(およびその後のRewriteLog
はSSL vhost):
68.231.66.6 - - [06/Jun/2013:15:08:51 --0700] [mysite.com/sid#7f67ac3fdf40][rid#7f67b213c0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] add path info postfix: /var/www/mysite.com/htdocs/order -> /var/www/mysite.com/htdocs/order/
68.231.66.6 - - [06/Jun/2013:15:08:51 --0700] [mysite.com/sid#7f67ac3fdf40][rid#7f67b213c0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] strip per-dir prefix: /var/www/mysite.com/htdocs/order/ -> order/
68.231.66.6 - - [06/Jun/2013:15:08:51 --0700] [mysite.com/sid#7f67ac3fdf40][rid#7f67b213c0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] applying pattern '^order/$' to uri 'order/'
68.231.66.6 - - [06/Jun/2013:15:08:51 --0700] [mysite.com/sid#7f67ac3fdf40][rid#7f67b213c0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='off' pattern='=off' => matched
68.231.66.6 - - [06/Jun/2013:15:08:51 --0700] [mysite.com/sid#7f67ac3fdf40][rid#7f67b213c0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] rewrite 'order/' -> 'https://mysite.com/order/'
68.231.66.6 - - [06/Jun/2013:15:08:51 --0700] [mysite.com/sid#7f67ac3fdf40][rid#7f67b213c0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] explicitly forcing redirect with https://mysite.com/order/
68.231.66.6 - - [06/Jun/2013:15:08:51 --0700] [mysite.com/sid#7f67ac3fdf40][rid#7f67b213c0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] escaping https://mysite.com/order/ for redirect
68.231.66.6 - - [06/Jun/2013:15:08:51 --0700] [mysite.com/sid#7f67ac3fdf40][rid#7f67b213c0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] redirect to https://mysite.com/order/ [REDIRECT/301]
SSL vhostは大規模なループを示します。
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] strip per-dir prefix: /var/www/mysite.com/htdocs/order/ -> order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] applying pattern '.*' to uri 'order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='on' pattern='=on' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='/order/' pattern='!^order' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] rewrite 'order/' -> 'http://mysite.com/order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] explicitly forcing redirect with http://mysite.com/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] escaping http://mysite.com/order/ for redirect
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] redirect to http://mysite.com/order/ [REDIRECT/301]
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] add path info postfix: /var/www/mysite.com/htdocs/order -> /var/www/mysite.com/htdocs/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] strip per-dir prefix: /var/www/mysite.com/htdocs/order/ -> order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] applying pattern '.*' to uri 'order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='on' pattern='=on' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='/order/' pattern='!^order' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] rewrite 'order/' -> 'http://mysite.com/order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] explicitly forcing redirect with http://mysite.com/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] escaping http://mysite.com/order/ for redirect
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] redirect to http://mysite.com/order/ [REDIRECT/301]
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] add path info postfix: /var/www/mysite.com/htdocs/order -> /var/www/mysite.com/htdocs/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] strip per-dir prefix: /var/www/mysite.com/htdocs/order/ -> order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] applying pattern '.*' to uri 'order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='on' pattern='=on' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='/order/' pattern='!^order' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] rewrite 'order/' -> 'http://mysite.com/order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] explicitly forcing redirect with http://mysite.com/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] escaping http://mysite.com/order/ for redirect
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] redirect to http://mysite.com/order/ [REDIRECT/301]
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] add path info postfix: /var/www/mysite.com/htdocs/order -> /var/www/mysite.com/htdocs/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] strip per-dir prefix: /var/www/mysite.com/htdocs/order/ -> order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] applying pattern '.*' to uri 'order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='on' pattern='=on' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='/order/' pattern='!^order' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] rewrite 'order/' -> 'http://mysite.com/order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] explicitly forcing redirect with http://mysite.com/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] escaping http://mysite.com/order/ for redirect
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] redirect to http://mysite.com/order/ [REDIRECT/301]
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] add path info postfix: /var/www/mysite.com/htdocs/order -> /var/www/mysite.com/htdocs/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] strip per-dir prefix: /var/www/mysite.com/htdocs/order/ -> order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] applying pattern '.*' to uri 'order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='on' pattern='=on' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='/order/' pattern='!^order' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] rewrite 'order/' -> 'http://mysite.com/order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] explicitly forcing redirect with http://mysite.com/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] escaping http://mysite.com/order/ for redirect
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] redirect to http://mysite.com/order/ [REDIRECT/301]
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] add path info postfix: /var/www/mysite.com/htdocs/order -> /var/www/mysite.com/htdocs/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] strip per-dir prefix: /var/www/mysite.com/htdocs/order/ -> order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] applying pattern '.*' to uri 'order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='on' pattern='=on' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='/order/' pattern='!^order' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] rewrite 'order/' -> 'http://mysite.com/order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] explicitly forcing redirect with http://mysite.com/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] escaping http://mysite.com/order/ for redirect
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] redirect to http://mysite.com/order/ [REDIRECT/301]
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] add path info postfix: /var/www/mysite.com/htdocs/order -> /var/www/mysite.com/htdocs/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] strip per-dir prefix: /var/www/mysite.com/htdocs/order/ -> order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] applying pattern '.*' to uri 'order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='on' pattern='=on' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='/order/' pattern='!^order' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] rewrite 'order/' -> 'http://mysite.com/order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] explicitly forcing redirect with http://mysite.com/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] escaping http://mysite.com/order/ for redirect
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21420a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] redirect to http://mysite.com/order/ [REDIRECT/301]
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] add path info postfix: /var/www/mysite.com/htdocs/order -> /var/www/mysite.com/htdocs/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] strip per-dir prefix: /var/www/mysite.com/htdocs/order/ -> order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] applying pattern '.*' to uri 'order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='on' pattern='=on' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='/order/' pattern='!^order' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] rewrite 'order/' -> 'http://mysite.com/order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] explicitly forcing redirect with http://mysite.com/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] escaping http://mysite.com/order/ for redirect
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b21460a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] redirect to http://mysite.com/order/ [REDIRECT/301]
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] add path info postfix: /var/www/mysite.com/htdocs/order -> /var/www/mysite.com/htdocs/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] strip per-dir prefix: /var/www/mysite.com/htdocs/order/ -> order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] applying pattern '.*' to uri 'order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='on' pattern='=on' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='/order/' pattern='!^order' => matched
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] rewrite 'order/' -> 'http://mysite.com/order/'
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] explicitly forcing redirect with http://mysite.com/order/
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] escaping http://mysite.com/order/ for redirect
68.231.66.6 - - [06/Jun/2013:15:11:34 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213a0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] redirect to http://mysite.com/order/ [REDIRECT/301]
68.231.66.6 - - [06/Jun/2013:15:11:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] add path info postfix: /var/www/mysite.com/htdocs/order -> /var/www/mysite.com/htdocs/order/
68.231.66.6 - - [06/Jun/2013:15:11:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] strip per-dir prefix: /var/www/mysite.com/htdocs/order/ -> order/
68.231.66.6 - - [06/Jun/2013:15:11:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (3) [perdir /var/www/mysite.com/htdocs/] applying pattern '.*' to uri 'order/'
68.231.66.6 - - [06/Jun/2013:15:11:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='on' pattern='=on' => matched
68.231.66.6 - - [06/Jun/2013:15:11:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (4) [perdir /var/www/mysite.com/htdocs/] RewriteCond: input='/order/' pattern='!^order' => matched
68.231.66.6 - - [06/Jun/2013:15:11:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] rewrite 'order/' -> 'http://mysite.com/order/'
68.231.66.6 - - [06/Jun/2013:15:11:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (2) [perdir /var/www/mysite.com/htdocs/] explicitly forcing redirect with http://mysite.com/order/
68.231.66.6 - - [06/Jun/2013:15:11:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] escaping http://mysite.com/order/ for redirect
68.231.66.6 - - [06/Jun/2013:15:11:35 --0700] [mysite.com/sid#7f67ac3e5020][rid#7f67b213e0a0/initial] (1) [perdir /var/www/mysite.com/htdocs/] redirect to http://mysite.com/order/ [REDIRECT/301]
それは多くの情報であり、私はそれを解析していますが、今のところ、私はロジックのエラーをキャッチするのに十分なスキルがありません。
したがって、コメントを拡張するために、リクエストパスに最初の/
がないように見えるため、次のようになります。
RewriteCond %{REQUEST_URI} !^/order/$
手がかりは、書き換えログの次の行でした。
RewriteCond: input='/order/' pattern='!^order' => matched
ルールが機能するためには一致しないようにする必要があります。
Mod_rewriteルールが開始時にRewriteBase /
を含むことは非常に一般的です(この場合、パターンに/
は必要ありません)。別の例から再コピーします。