我有一个旧网站,在Google上已经很好地编入索引,然后我需要制作301才能让ex。 Google知道页面已被移动。
我将我的网站从Wordpress移动到“建立的操作系统”,但是使用单个网址。
第一页很顺利,但当我需要301重定向子链接时,它会失败。
代码:
Redirect 301 /what-we-do/ mypage.nu/services
Redirect 301 /what-we-do/about-us mypage.nu/about
第二行乱搞并使其成为“serviceabout” - 无法找到。
如何从旧网址和子网址创建连字符( - ),以指向“单个网址” - 这是我的意思,从前。 mypage.nu/what-we-do/about-us/members to ex mypage.nu/members
请帮助我,我尝试了几个规则表达式
Redirect 301 /what-we-do/about([^/_]+?)-?us mypage.nu/about
没有任何作用,但我可以做一个RewriteMatch - 所以我的服务器上激活了mod_rewrite。
任何人都可以帮助我吗?
答案 0 :(得分:0)
使用RedirectMatch
获取正则表达式支持以匹配确切的网址:
RedirectMatch 301 ^/what-we-do/?$ mypage.nu/services
RedirectMatch 301 ^/what-we-do/about-us/?$ mypage.nu/about
最好在新浏览器中对此进行测试,以避免旧缓存。