0
私はリダイレクトする必要がある2つのパターンがあります。URLパラメータ付きHtaccess - 注文
www.example.com/tag/value to www.example.com/recipe-tag/value
www.example.com/?tag=value to www.example.com/recipe-tag/value
これは、これが最初のリダイレクトのために働く私の現在の.htaccess
RewriteEngine On
RewriteBase/
RewriteRule ^tag/(.*) http://www.example.com/recipe-tag/$1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
です。 2番目のリダイレクトを有効にするにはどうすればよいですか?
作品。どうもありがとう ! – vanipriya
これに問題があります。パターンがwww.example.com/?tag=valueの場合にのみパターンを選択したい 「タグ」がURLの他の場所に存在する場合でも、これが選択されます。このパターンを検証する方法は? – vanipriya
'tag =(。+)$'を '^ tag =(。+)$'に変更してみてください –