使用请求的URI重定向到不同的URL

时间:2013-01-31 17:42:21

标签: php .htaccess

您好我想将每个请求的URI重定向到具有相同URI的另一个网址:) 喜欢这个

http://www.fb.com/everything

重定向到

http://www.facebook.com/everything

http://www.fb.com/anotherthing

重定向到

http://www.facebook.com/anotherthing

我想动态

使用php或htaccess

2 个答案:

答案 0 :(得分:1)

您需要的只是Redirect directive

Redirect 301 / http://www.facebook.com/

答案 1 :(得分:0)

要重定向来自该点击的所有流量,您的htaccess请使用以下代码

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_URI} ^/$
    RewriteRule ^(.*)$ http://domain.tld/$1 [R=301,L]
</IfModule>
相关问题