本文介绍了如何使用.htacess重定向修改后的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将我的网站移至新域.但是,面临永久链接结构的问题.例子,
I want to move my website to a new domain. But, facing a problem with Permalink structure. Example,
Old Structure: oldsite/salman-khan-biography/ New Structure: newsite/salman-khan-movies/实际上,从永久链接的末尾仅更改单个单词. 我尝试了以下代码,但显示在新域中找不到404.
Actually, just single word will be changed from the end of permalinks. I tried below codes, but it's showing 404 not found on the new domain.
RewriteEngine on RewriteCond %{HTTP_HOST} ^oldsite [NC,OR] RewriteCond %{HTTP_HOST} ^www.oldsite [NC] RewriteRule ^(.*)$ newsite/$1 [L,R=301,NC]推荐答案
在旧网站htaccess中尝试以下操作.
Try with below in your old website htaccess.
RewriteEngine On RewriteCond %{REQUEST_URI} (.+)\-biography/?$ RewriteRule ^ newsite/%1-movies/ [R=301]更多推荐
如何使用.htacess重定向修改后的URL
发布评论