0

過去数時間、drupalのルートにある.htaccessファイルを使用して、古いmamboWebサイトから新しいdrupal7Webサイトへのカスタムリダイレクトを作成しようとしています。私がやりたいのは...

301リダイレクト

http://mysite.com/index.php?option=com_content&task=blogsection&id=11&Itemid=54

http://mysite.com/this-is-the-new-page

これは私の.htaccessファイルです...

RewriteEngine on

RewriteRule ^index.php?option=com_content&task=blogsection&id=11&Itemid=54$ http://mysite.com/this-is-the-new-page [R=301,L]

RewriteRule "(^|/)\." - [F]

RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]

私はそれがこの行と関係があると確信しています...

RewriteRule ^ index.php [L]

でもわからない!私がこれを使うかどうかわかります...

RewriteRule ^option=com_content&task=blogsection&id=11&Itemid=54$ http://mysite.com/this-is-the-new-page [R=301,L]

これの代わりに...

RewriteRule ^index.php?option=com_content&task=blogsection&id=11&Itemid=54$ http://mysite.com/this-is-the-new-page [R=301,L]

そして、FirefoxとLiveHTTPヘッダーアドオンでテストしてください。

助言がありますか?!

ありがとう!

4

1 に答える 1

1

クエリ文字列はURLパスパターンの一部ではありません。クエリ文字列に基づいてルールを作成する場合は、RewriteCond

RewriteEngine on
RewriteCond %{QUERY_STRING} option=com_content&task=blogsection&id=11&Itemid=54
RewriteRule ^index.php$ /this-is-the-new-page? [R,L]
于 2013-03-20T21:05:58.640 に答える