HTML >
(on Wikipedia · HTTP 301)
Table of Contents [hide]
HTML redirect ∞
<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="refresh" content="1;url=http://example.com/"> <script type="text/javascript"> window.location.href = "http://example.com/" </script> <title>Page Redirection</title> </head> <body> <a href='http://example.com/'>http://example.com/</a> </body> </html>
301 permanent redirect ∞
Using .htaccess ∞
https://web.archive.org/web/20190320223607/http://www.stevenhargrove.com:80/redirect-web-pages/
Redirect 301 /old/old.html http://example.com/new.html
Using mod_rewrite ∞
RewriteEngine On rewritecond %{http_host} ^example.com rewriteRule ^(.*) http://example.com/$1 [R=301,L]
using PHP ∞
(PHP)
<? header( "HTTP/1.1 301 Moved Permanently" ); header( "Status: 301 Moved Permanently" ); header( "Location: http://example.com/" ); exit(0); // This is Optional but suggested, to avoid any accidental output ?>
Using Rails ∞
(Rails)
def old_action headers["Status"] = "301 Moved Permanently" redirect_to "http://example.com/" end
Last updated 2020-06-21 at 05:43:03
ported
merged 301 permanent redirect