1

非常に多くの質問がそれに近づいていますが、完全ではありません。正規表現が頭を混乱させるのではないかと心配しています!

いくつかの URL をわずかに修正したサイトの再コーディングの後、Google で 404 になりたくないので、再マップするための 301 リダイレクトを探しています。

http://www.oursite.com/listing-product-name-1234.html

http://www.oursite.com/product-name-1234.html

...you can see we just want to drop "listing-". The "1234" is a unique ID per product, and the product name can be multiple words (hyphen separated) by the way.

Thanks very much for the help regex heads!

4

2 に答える 2

0

これを試して:

RewriteCond     %{REQUEST_URI}     ^/listing-(\w+-)+\d+\.html
RewriteRule     ^listing-(.*)      $1
于 2013-06-28T14:31:26.410 に答える