动态链接重定向至的.htaccess

编程入门 行业动态 更新时间:2024-10-09 00:42:24
本文介绍了动态链接重定向至的.htaccess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好 我有一个像 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

本文发布于:2023-11-02 07:09:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551705.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   链接   动态   htaccess

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!