您好 我有一个像 HTTP链接://blog.a$c $ c / 2010/06 /混帐功能于窗口/ 现在我想将它重定向到 HTTP://一个code .COM / 2010/06 /混帐功能于窗户/
Hello I have a link like blog.acode/2010/06/git-in-windows/ now I want to redirect it to acode/2010/06/git-in-windows/
不过,2010/06 /混帐功能于窗口/这部分是不是一个静态的字符串,这可能会改变动态根据博客内容。
But "2010/06/git-in-windows/" this part is not a static string this might change depending on blog content dynamically.
如何做到这一点这样的.htaccess或PHP脚本或者两者兼而有之?
How to do this this .htaccess or php scripts or with both ?
感谢
推荐答案这将移动重定向从 blog.a code 的任何链接 A code 同时保持URL路径不变。它基本上只是删除博客的链接,并将其发送回。
This will move redirect any link from blog.acode to acode while keeping the path of the url intact. It basically just removes blog from the link and sends it back.
RewriteEngine On RewriteCond %{HTTP_HOST} ^blog.acode$ [NC] RewriteRule ^(.*)$ acode/$1 [R=301,L]您应该用新域名更新博客软件配合这一行动。如果不这样做可能会引起不必要的混乱,这甚至不能被察觉。
You should complement this action by updating your blogging software with the new domain name. Failing to do so might lead to unnecessary complications, that could not even be noticed.
更多推荐
动态链接重定向至的.htaccess
发布评论