我创建了一个新网站。旧的使用http,新的使用https,并且具有不同的URL路径。
示例:
OLD: website.com/index.php/powerpoint-presentation
NEW: https://website.com/powerpoint-presentation如何在.htaccess中以这种方式定向单个URL?我想做大约10个手动301重定向。
发布于 2019-02-18 20:12:31
在旧网站的.htaccess文件中,您可以使用如下内容:
Redirect 301 /index.php/powerpoint-presentation https://website.com/powerpoint-presentation当然,您可以根据需要使用任意数量的工具。
发布于 2019-02-19 04:41:14
单重定向可以像Dave提到的那样完成:
Redirect 301 /index.php/powerpoint-presentation https://website.com/powerpoint-presentation但是,如果所有旧URL的结构都相同,而您只想删除/index.php/,则可以这样做:
RewriteEngine On
RewriteRule ^index\.php/(.*)$ https://website.com/$1 [R=301,L]这会将任何具有旧/index.php/结构的URL重定向到https://网站上的相同URL,而不是/index.php/
https://stackoverflow.com/questions/54741842
复制相似问题