0

ブートストラップを使用していて、それを修正する方法を見つける必要があるため、かなり厄介なリダイレクト ループが発生しています。ただ注意してください。しかし、forwarder.dev/direct-mail/{2 digit var}?CampId={7 digit var} から Zend Router でこれを別の場所に転送していますが、この中間ページは存在しません。残念ながら、htaccess ホップをスキップすることはできません。

Options +FollowSymLinks
Options -Indexes

RewriteEngine On

# Move CampID's -> directmail
RewriteCond %{HTTP_HOST} ^(www\.)?forwarder\.dev [NC]
RewriteCond %{REQUEST_URI} !^/direct-mail/
RewriteCond %{QUERY_STRING} ^(?i:campid)=(\w{2})(\w{5})
RewriteRule ^(.*)$ http://www.forwarder.dev/direct-mail/%1?CampId=%1%2 [R=301,L]


# Bootstrap stuff for Zend
Redirect 301 /index.php/ /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(js|ico|gif|jpg|png|css) /index.php [L]

LogLevel 15 からのエラー

[rid#b6ddb058/initial] (3) [perdir /var/www/forwarder.dev/] add path info postfix: /var/www/forwarder.dev/direct-mail -> /var/www/forwarder.dev/direct-mail/HA
[rid#b6ddb058/initial] (3) [perdir /var/www/forwarder.dev/] strip per-dir prefix: /var/www/forwarder.dev/direct-mail/HA -> direct-mail/HA
[rid#b6ddb058/initial] (3) [perdir /var/www/forwarder.dev/] applying pattern '^(.*)$' to uri 'direct-mail/HA'
[rid#b6ddb058/initial] (4) [perdir /var/www/forwarder.dev/] RewriteCond: input='www.forwarder.dev' pattern='^(www\.)?forwarder\.dev' [NC] => matched
[rid#b6ddb058/initial] (4) [perdir /var/www/forwarder.dev/] RewriteCond: input='/direct-mail/HA' pattern='!^/direct-mail/' => not-matched
[rid#b6ddb058/initial] (3) [perdir /var/www/forwarder.dev/] add path info postfix: /var/www/forwarder.dev/direct-mail -> /var/www/forwarder.dev/direct-mail/HA
[rid#b6ddb058/initial] (3) [perdir /var/www/forwarder.dev/] strip per-dir prefix: /var/www/forwarder.dev/direct-mail/HA -> direct-mail/HA
[rid#b6ddb058/initial] (3) [perdir /var/www/forwarder.dev/] applying pattern '\.(js|ico|gif|jpg|png|css)' to uri 'direct-mail/HA'
[rid#b6ddb058/initial] (4) [perdir /var/www/forwarder.dev/] RewriteCond: input='/var/www/forwarder.dev/direct-mail' pattern='!-f' => matched
[rid#b6ddb058/initial] (4) [perdir /var/www/forwarder.dev/] RewriteCond: input='/var/www/forwarder.dev/direct-mail' pattern='!-d' => matched
[rid#b6ddb058/initial] (2) [perdir /var/www/forwarder.dev/] rewrite 'direct-mail/HA' -> '/index.php'
[rid#b6ddb058/initial] (1) [perdir /var/www/forwarder.dev/] internal redirect with /index.php [INTERNAL REDIRECT]
[rid#b6dd2578/initial/redir#1] (3) [perdir /var/www/forwarder.dev/] strip per-dir prefix: /var/www/forwarder.dev/index.php -> index.php
[rid#b6dd2578/initial/redir#1] (3) [perdir /var/www/forwarder.dev/] applying pattern '^(.*)$' to uri 'index.php'
[rid#b6dd2578/initial/redir#1] (4) [perdir /var/www/forwarder.dev/] RewriteCond: input='www.forwarder.dev' pattern='^(www\.)?forwarder\.dev' [NC] => matched
[rid#b6dd2578/initial/redir#1] (4) [perdir /var/www/forwarder.dev/] RewriteCond: input='/index.php' pattern='!^/direct-mail/' => matched
[rid#b6dd2578/initial/redir#1] (4) [perdir /var/www/forwarder.dev/] RewriteCond: input='CampId=HA12345' pattern='^(?i:campid)=(\w{2})(\w{5})' => matched
[rid#b6dd2578/initial/redir#1] (2) [perdir /var/www/forwarder.dev/] rewrite 'index.php' -> 'http://www.forwarder.dev/direct-mail/HA?CampId=HA12345'
[rid#b6dd2578/initial/redir#1] (3) split uri=http://www.forwarder.dev/direct-mail/HA?CampId=HA12345 -> uri=http://www.forwarder.dev/direct-mail/HA, args=CampId=HA12345
[rid#b6dd2578/initial/redir#1] (2) [perdir /var/www/forwarder.dev/] explicitly forcing redirect with http://www.forwarder.dev/direct-mail/HA
[rid#b6dd2578/initial/redir#1] (1) [perdir /var/www/forwarder.dev/] escaping http://www.forwarder.dev/direct-mail/HA for redirect
[rid#b6dd2578/initial/redir#1] (1) [perdir /var/www/forwarder.dev/] redirect to http://www.forwarder.dev/direct-mail/HA?CampId=HA12345 [REDIRECT/301]
4

1 に答える 1

1

わかりました、すべて一致していました。正しい方法はこれを使用することでした

RewriteRule ^$ http://www.forwarder.dev/direct-mail/%1?CampId=%1%2 [R=301,L]

それ以外の^(.*)$

于 2012-11-01T04:46:20.500 に答える