🔍

首页Home › 开发工具Developer Tools

↪️ 网页跳转代码生成Redirect Code Generator

输入目标网址,一键生成 PHP、JavaScript、HTML meta、Java、JSP、Python、Node.js、Go、ASP、ASP.NET、Perl 以及 Apache、Nginx 的 301/302 跳转代码。Enter a target URL and get 301/302 redirect code for PHP, JavaScript, HTML meta, Java, JSP, Python, Node.js, Go, ASP, ASP.NET, Perl, Apache and Nginx.

使用说明与常见问题How-to & FAQ

「网页跳转代码生成」是什么?What is the Redirect Code Generator tool?

输入目标网址,一键生成 PHP、JavaScript、HTML meta、Java、JSP、Python、Node.js、Go、ASP、ASP.NET、Perl 以及 Apache、Nginx 的 301/302 跳转代码。Enter a target URL and get 301/302 redirect code for PHP, JavaScript, HTML meta, Java, JSP, Python, Node.js, Go, ASP, ASP.NET, Perl, Apache and Nginx.

如何使用「网页跳转代码生成」?How do I use the Redirect Code Generator?

在输入框填写要跳转到的完整网址,选择 301(永久)或 302(临时)和需要的语言,复制生成的代码放进你的页面或配置即可。前端跳转(JS、meta)无法返回真正的 301 状态码。Enter the full destination URL, choose 301 (permanent) or 302 (temporary) and a language, then copy the code into your page or config. Client-side redirects (JS, meta) cannot send a real 301 status.

301 和 302 怎么选?Should I use 301 or 302?

网址永久搬家(换域名、改版后旧链接)用 301,搜索引擎会把收录和权重转移到新地址;只是临时跳转(活动页、维护页)用 302。307/308 与 302/301 含义相同,但要求浏览器保持原来的请求方法(如 POST)。Use 301 when a URL has moved for good (new domain, old links after a redesign) so search engines transfer indexing to the new URL; use 302 for temporary moves. 307/308 mean the same as 302/301 but require the browser to keep the request method (e.g. POST).

PHP 跳转报 headers already sent 怎么办?What if PHP says "headers already sent"?

header() 必须在任何输出(包括 HTML、空格、BOM)之前调用。把跳转代码放到文件最开头,并确认文件保存为无 BOM 的 UTF-8。header() must run before any output, including HTML, whitespace or a BOM. Put the redirect at the very top of the file and save it as UTF-8 without BOM.

「网页跳转代码生成」免费吗?数据会上传吗?Is the Redirect Code Generator free? Is my data uploaded?

「网页跳转代码生成」完全免费,无需注册或安装,手机和电脑都能用;所有处理都在你的浏览器本地完成,输入的内容和文件不会上传到服务器。The Redirect Code Generator is completely free with no sign-up or install and works on phones and desktops; everything runs locally in your browser and nothing you enter is uploaded.

相关工具Related tools

↪️ .htaccess / Nginx 重定向生成器Redirect Generator (.htaccess & Nginx)🚦 HTTP 状态码大全HTTP Status Codes List🧩 URL 解析器URL Parser🧾 JSON 格式化校验JSON Formatter & Validator🗄️ SQL 格式化/压缩SQL Formatter & Minifier🗃️ SQL 建表语句转 Java 实体类SQL (CREATE TABLE) to Java Entity💠 JSON 转 C# 实体类JSON to C# Class🗄️ JSON 转 SQLJSON to SQL Converter🗄️ SQL 转 JSON(INSERT 语句转 JSON)SQL to JSON Converter🗃️ CSV 转 SQL(INSERT 语句)CSV to SQL Converter

← 全部工具All tools