1

由于需要重定向的站点结构设计更改,我有大量的 404。

有人可以告诉我如何使用 htaccess 中的模式来做到这一点

key-creative-wedding-photography/60-the-key-to-creative-wedding-photography-3/contact
key-creative-wedding-photography/090-the-key-to-creative-wedding-photography-3/contact
hayling-island-beach/img_7459-hayling-island-beach/contact
farbridge-wedding-photographers/_0287-farbridge-wedding-photographers-2/contact

请注意有一个页面叫做 ./contact

有任何想法吗?

谢谢!

4

1 回答 1

2

您可以尝试将这些规则添加到文档根目录中的 htaccess 文件中(最好在该文件中的任何其他规则之前):

RewriteEngine On
RewriteRule ^(.+)/contact$ /contact [L,R=301]

这需要任何/contact/contact.

于 2013-11-11T15:36:19.897 回答