【问题标题】:301 redirect help - .htm removed and few urls changed301 重定向帮助 - 删除了 .htm 并更改了一些 url
【发布时间】:2013-05-12 08:43:55
【问题描述】:

我正在将内容从旧的 Dreamweaver 站点移动到新的 wordpress 站点,所有文件名都相同,除了新的 wordpress 的末尾没有 .htm。

更改了某些类别/子目录段。

我想 301 域和所有页面到新域名。

大多数网址:

旧内容网址:http://olddomain.com/reviews/soft/graphics/filename.htm

新页面的位置:http://newdomain.com/reviews/soft/graphics/filename

一些类别/子类:

旧版:http://olddomain.com/reviews/hard/sound/filename.htm

新:http://newdomain.com/reviews/hard/sound-review/filename

301 htaccess 文件会是什么样子?

(注意:新旧网址都有www.,旧域名也需要重定向所有非www)

感谢任何帮助

【问题讨论】:

    标签: wordpress .htaccess http-status-code-301


    【解决方案1】:

    301 htaccess 文件会是什么样子?

    olddomain.com 文档根目录的 htaccess 文件中:

    RedirectMatch 301 ^/([^/]+)/([^/]+)/([^/]+)/(.*)\.htm$ http://newdomain.com/$1/$2/$3/$4
    

    【讨论】:

    • @MaxBramwell 这匹配/anything/anything/anything/anything.htm。只有/.htm 是常量
    猜你喜欢
    • 2020-03-04
    • 2011-07-25
    • 2019-05-12
    • 1970-01-01
    • 1970-01-01
    • 2014-11-16
    • 2013-06-28
    • 2010-12-24
    • 1970-01-01
    相关资源
    最近更新 更多