■/news/index.php?cat=1 を /news/cat1/index.html へリダイレクトする際の書き方
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} ^/news/index.php$ [NC]
RewriteCond %{QUERY_STRING} "cat=1"
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /news/cat1/index.html? [R=301,L]
※最後に?を付けないと、/news/cat1/index.html?cat=1 となってしまうから ? をつけましょう。
0 件のコメント:
コメントを投稿