htaccess重写迁移其他域

编程入门 行业动态 更新时间:2024-10-08 06:25:46
本文介绍了htaccess重写迁移其他域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何使用htaccess模块​​重写来更改传入链接的基本域?

How do I change the base domain of an incoming link using htaccess module rewrite?

传入网址:

www.foo/bar?name1=value1&name2=value2

重写的网址:

www.newFoo/bar?name1=value1&name2=value2

Apache Web服务器应该简单地重写其所有传入的URL,因为Web服务器本身不再保存任何网站。

Apache webserver should simply rewrite all of its incoming urls, on the webserver itself no websites are saved anymore.

推荐答案

将其添加到您的Web根

Add this to your .htaccess in your web root / directory of the server hosting www.foo

RewriteEngine on RewriteCond %{HTTP_HOST} ^(www\.)?foo\$ [NC] RewriteRule ^(.*)$ www.newfoo/$1 [R=301,L]

更多推荐

htaccess重写迁移其他域

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

发布评论

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

>www.elefans.com

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