Skip to main content

Tedshd's Dev note

HTML - redirect page from http-equiv

Table of Contents

# HTML - redirect page from http-equiv

## Intro

We can use JavaScript or PHP redirect page, we also can only use HTML redirect page

But not suggest use this way

Note: The value “refresh” should be used carefully, as it takes the control of a page away from the user. Using “refresh” will cause a failure in W3C’s Web Content Accessibility Guidelines.

使用 標籤進行重新導向可能會降低搜尋引擎排名。

## Usage

<meta http-equiv="refresh" content="0;url=http://example.com">

<!-- add content -->
If you are not redirected automatically, follow the <a href='http://example.com'>link to example</a>

## Best way

Use PHP redirect or JavaScript And http status is 301

Refer - HTML meta http-equiv Attribute

Refer - WEB1041 - 目前使用 <meta http-equiv="refresh"> 元素進行重新導向

Refer - Redirect from an HTML page? - Stack Overflow

Refer - 轉導、轉向(Redirect)網址的方法. - 諸彼特租屋網