1

間違った URL で多くの人にメールを送信したので、.htaccess で修正する必要があります。間違った URL:

https://amemoirproject.com/chapters/leaving-tanglewood/?utm_medium=email&utm_campaign=Chapter+15+The+Anointed&utm_content=Chapter+15+The+Anointed+CID_6d1662ca75fabbdcbd66397fc00cdcf4&utm_source=Campaign%20Monitor&utm_term=Chapter%2015%20The%20Anointed%20%20A%20Long-Haired%20Handsome%20Jesus

正しい URL:

https://amemoirproject.com/chapters/the-anointed/?utm_medium=email&utm_campaign=Chapter+15+The+Anointed&utm_content=Chapter+15+The+Anointed+CID_6d1662ca75fabbdcbd66397fc00cdcf4&utm_source=Campaign%20Monitor&utm_term=Chapter%2015%20The%20Anointed%20%20A%20Long-Haired%20Handsome%20Jesus

唯一の違いは、ディレクトリが からleaving-tanglewoodに変更されたことthe-anointedです。クエリ文字列を保持する必要があり、これは 302 である必要があります。

提案?

編集

この 302 リダイレクトは、元の不正な URL に次のクエリ パラメータと値が含まれている場合にのみ発生します。

utm_campaign=Chapter+15+The+Anointed
4

1 に答える 1

1

mod_rewrite と .htaccess を有効にしてからhttpd.conf、このコードをディレクトリの.htaccess下に配置します。DOCUMENT_ROOT

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{QUERY_STRING} (^|&)utm_campaign=Chapter\+15\+The\+Anointed(&|$) [NC]
RewriteRule ^(chapters)/leaving-tanglewood/?$ /$1/the-anointed/ [L,NC,R=302]
于 2013-08-19T14:30:27.990 に答える