0

ドレスの URL を にリダイレクトしたいと思いapparel-clothes/dressesます。例えば:

  • abc.com/dresses
  • abc.com/dresses/casual
  • abc.com/dresses/evening-wear
  • abc.com/dresses/little-black-dress

すべて にリダイレクトする必要がありますabc.com/apparel-clothes/dresses。リダイレクト ルールを記述しようとしましたが、機能しません。

RewriteRule ^(.*)/dresses/(.*)$ $1/apparel-clothes/dresses/$2 [R=301,L]
4

2 に答える 2

0

The domain name is never part of your RewriteRule, so you should not include it (or else, the first capture group you are defining doesn't make sense). It should look more like this:

RewriteRule ^dresses/?(.*)$ /apparel-clothes/dresses/$1 [R=301,L]

That will rewrite http://abc.com/dresses to http://abc.com/apparel-clothes/dresses/ and so on.

于 2013-10-17T11:32:37.633 に答える