Last active
July 18, 2016 11:00
-
-
Save DmitriyRF/f67fe4470099b03060e890779bbf2bfb to your computer and use it in GitHub Desktop.
Оптимальный redirect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Внизу приведён оптимальный способ перенаправления пользователя на другую страницу, | |
в том случае, например, если вы поменяли домен. | |
Работает практически в любом браузере. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | |
<html> | |
<head> | |
<script language="JavaScript1.1" type="text/javascript"> | |
<!-- | |
location.replace("http://www.new.site/page.html"); // текущая страница будет заменена в history на новую — важно в плане юзабилити | |
//--> | |
</script> | |
<noscript> | |
<meta http-equiv="Refresh" content="0; URL=http://www.new.site/page.html"> <!-- для тех нескольких процентов «сёрферов», которые отключили JavaScript --> | |
</noscript> | |
</head> | |
<body> | |
Мы перебрались на <a href="http://www.new.site/page.html">новое местечко</a>. | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment