简单页转到? [英] Simple Page Redirect?

查看:204
本文介绍了简单页转到?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面 http://site.com/services/ ,我只是想重定向它 http://site.com/servics/first-service/

I have a page at http://site.com/services/ and I just want to redirect it to http://site.com/servics/first-service/

最新最好的重定向做到这一点,我怎么做到这一点?

Whats the best redirect to do this and how do I do this?

推荐答案

PHP

header("Location: yourpage.php");
exit;

您必须使用退出模具以停止执行你的code。 此外,code有任何输出之前执行。

You have to use exit or die after header in order to stop execution of your code. Also, the code has to be executed before any output.

HTML

<meta http-equiv="refresh" content="0;url=yourpage.php">

在code之间应&LT; HEAD&GT;&LT; /头&GT; 标签

的JavaScript

window.location = "yourpage.php";


的.htaccess


.htaccess:

Redirect 301 /oldpage.php /newpage.php

这篇关于简单页转到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆