How to redirect urls with /#!/ with .htaccess

问题描述 投票:0回答:0

我需要将旧网站网址重定向到新网址,但它们都使用 domain.com/#!/uri 进行索引,/#!/ 给我带来了问题。 例如,我需要重定向:/#!/themes 到/thematique/。 我想重定向以在旧页面上保留谷歌搜索引擎优化。

我尝试了多个正则表达式,甚至在我的 .htaccess 中指定了每个 url,但都被忽略了(我猜是因为 #)。

RedirectMatch 301 ^/#!/themes$ /thematique/

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)\%\23\%21\%2F(.*)\ HTTP/
RewriteRule ^ /%2? [R=301,L]

我做错了吗或者这可能吗?

谢谢

apache .htaccess redirect http-redirect litespeed
© www.soinside.com 2019 - 2024. All rights reserved.