pixelbrackets/html-redirect

生成HTML标记以请求重定向,而不是发送位置头

1.2.0 2020-11-04 10:27 UTC

This package is auto-updated.

Last update: 2024-09-07 01:33:11 UTC


README

Version Build Status Made With License Contribution

生成HTML标记以请求重定向,而不是发送位置头。

Screenshot

愿景

该包提供有效的HTML标记以将请求重定向到另一个位置。

重定向方法是在生成可能不使用位置头的静态网站时的一个替代方案。

请参阅»用法«以获取示例。

该包遵循KISS原则。

需求

  • PHP

安装

Packagist条目 https://packagist.org.cn/packages/pixelbrackets/html-redirect/

源代码

https://gitlab.com/pixelbrackets/html-redirect/

镜像 https://github.com/pixelbrackets/html-redirect/

演示

⌨️ php tests/demo.php.

用法

  1. 获取重定向到https://example.com的标记并写入文件
    $redirectMarkup = \Pixelbrackets\HtmlRedirect\HtmlRedirect::redirect('https://example.com/');
    file_put_contents('/var/www/example/index.html', $redirectMarkup);
    

该包仅创建标记,您需要自己写入文件或创建PSR-7响应。

许可证

GNU通用公共许可证版本2或更高版本

GNU通用公共许可证可在https://gnu.ac.cn/copyleft/gpl.html找到。

作者

Dan Untenzu (mail@pixelbrackets.de / @pixelbrackets)

变更日志

请参阅./CHANGELOG.md

贡献

此脚本是开源的,因此请使用、修补、扩展或分叉它。

贡献 受欢迎!