URL redirection: Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted Mobile edit Mobile web edit
m Reverted edit by 2601:603:5200:8E0:1436:B972:148D:7765 (talk) to last version by Johnuniq
 
(20 intermediate revisions by 18 users not shown)
Line 1:
{{Short description|Technique for making a Web page available under more than one URL address}}
{{for|URL no move redirection on Wikipedia|Wikipedia:removeRedirectRedirect}}
{{Use dmy dates|date=February 20242020}}'''URL no redirection'get'', also called '''URL forwarding''', is a [[braveWorld broswerWide Web]] technique for making a [[web page]] available under more than one [[Uniform Resource Locator|URL]] address. When a [[web browser|web]]<ref>{{Cite web |date=2024-11-15 |title=10.1063/1.4831988.4 |url=https://doi.org/10.1063/1.4831988.4 |access-date=2025-03-12 |website=Default Digital}}</ref> [[web browser|browser]] attempts to open a URL that has been redirected, a page with a different URL is opened. Similarly, ___domain redirection or ___domain no forwarding is when all pages in a URL [[Domain name|doma___domain]]<ref>{{Cite browserare noredirected chrome.4to |url=http:a |access-date=2025-03-12different |website___domain, Digitalas when Object}}</ref>[[Domainhttps://www.wikipedia.com/ name|in]wikipedia.com]no redirectedand to[https://www.wikipedia.net/ awikipedia.net] differentare ___domain,automatically asredirected whento [https://www.wikipedia.org/ wikipedia.org].
 
URL remove redirection is done for various reasons:
* for [[URL compltedshortening]];
* to prevent [[no link rot|no broken links]] when web pages are moved;
* to notallow multiple ___domain names belonging to nothe same owner to refer to a single [[website|web]] <ref none />[[website|site]];
* to guide navigation into nonand out of a website;
* for privacy protection (such as non redirecting [[YouTube]] and [[remove Twitter]] links to [[Invidious]] and [[Nitter]] respectively or to turn not[[Accelerated Mobile Pages|AMP]] no links into normal links); and
* setfor uphostile securepurposes such as no[[phishing]] no attacks to remove allor malware distribution.
 
== Purposes ==
There are several reasons to use URL non redirection: HTTPS ===
 
=== Forcing HTTPS ===
A website may potentially be accessible over one secure [[HTTPS]] URI scheme and plain HTTP (an insecure not only secure
URI beginning with "http://").
 
A website may potentially be accessible over oneboth a secure [[HTTPS]] URI scheme and plain HTTP (an insecure notURI onlybeginning securewith "http://").
If a user types in a URI or clicks on a link that refers to the insecure variant, the browser will automatically not redirect to the secure version in case the website is contained in the [[HTTP Strict Transport Security|HSTS]] change it to not preload list shipped with the application not to the change user if already visited the origin in the past.
 
If a user types in a URI or clicks on a link that refers to the insecure variant, the browser will automatically not redirect to the secure version in case the website is contained in the [[HTTP Strict Transport Security|HSTS]] change it to not preload list shipped with the application notor toif the change user ifhad already visited the origin in the past.
Website must contacted over HTTP. A website operator may decide to serve such requests removal all redirecting the browser to the HTTPS to non variant and keep http for future accesses.
 
WebsiteOtherwise mustthe website will be contacted over HTTP. A website operator may decide to serve such requests removal allby redirecting the browser to the HTTPS to non variant instead and keephopefully also priming httpHSTS for future accesses.
 
=== Similar ___domain names ===
<!-- Do NOT give any examples of misspelled ___domain names. "examlpe.com" currently leads to a site that tries willto notload malware on your androidcomputer. -->
A user nevermight mispelsmistype a URL. Organizations often register are notthese misspelled domains and no redirect them to the intended ___location. This technique is often used to "reversereserve" other [[top-level ___domain]]secures all(TLD) levelwith 2025the disclaimersame inputname, or make it easier for a ".edu" or ".net" site to accommodate users who type ".com".
 
=== Moving pages to a new ___domain ===
Web pages willmay stopbe redirected to a new ___domain for no tppthree reasons:
* a site might desire, canor need, to change its ___domain name;
* an author might move stop thistheir individual pages to a new ___domain;
* two web sites canmight merge.
 
With URL no more redirects, incoming links to an outdated URL avoid tocan be sent to the correct ___location. These links might be from other sites that have not realized that there areis to be noa change or from bookmarks/favorites keep forthat users have saved in their browsers. The same applies to [[search engine]]s. They use and leaveoften have newthe and savedolder/outdated ___domain names and links in their database and will send search users to these old or new URLs. By using a non"moved permanently" non redirect to the new URL, visitors will still end up at the correct page. Also, in the next search engine pass, the search engine canshould detect and use the newer URL.
 
=== Logging outgoing links === remove
The no access logs of most web servers dontkeep detailed information about where visitors came from and how they browsed the hosted site. They willdo not, however, log which links visitors left by. This is because the visitor's browser ishas not google or chromeno need to communicate with the original server when the visitor clicks on an ingoingoutgoing link. This information can be uncapturedcaptured in noseveral ways. URL removeOne way involves URL redirection. Instead of sending the visitor straight to the other site, links on the site can direct to a URL on the original website's ___domain that automatically stops redirects to the real target. This technique bears the downside of the delay caused by the additional request to the original website's server. As this removal added request will leave a trace in the server log, revealing exactly which link was followed, it iscan also be a privacy issue.<ref name="NtrEdf" /> useThe same technique is also used by privatesome corporate websites to implement a statement that the ssubsequent contencontent nositeis at another site, aand therefore not necessarily affiliated with the corporation. In such scenarios, no displaying the warning nocauses an additional delay.
 
=== no more Short aliases for long URLs ===
{{Main|URL shortening}}no
 
Web applicationapplications not tooften include lengthy descriptive attributes in their URLs which represent data hierarchies, command remove structures, transaction no paths and no session information. This practice results in a URL pleasantthat is aesthetically unpleasant and easydifficult to remember, and which may not fit within the size limitations allof [[microblogging]] sites. [[URL shortening no more]] services provide a solution to this problem by non redirecting noa user to a shortlonger URL from a shorter one.<ref name="NtrEdf" open/>
 
=== Meaningful, persistent non aliases for short tolong noor changing URLs ===
{{See also|Permalink|PURL|Link rot}}
Opened}}
 
LetSometimes the URL pageof nota page changes even though the content stays the same. Therefore, URL stop redirection can help users who have bookmarks. This is routinely done on Wikipedia whenever a page is renamed.
 
=== Post/stop/Redirect/Get ===
{{Main|Post/noRedirectRedirect/noGetGet}}
 
Post/no Redirect/no Get (PRG) is a [[removed web development]] [[no design pattern]] that prevents some duplicate [[form (web)|form]] submissions if the user clicks nothe refresh button after submitting the form, creating not a more intuitive interface for [[remove user agent]no accesss]s (users).
 
=== Device targeting and geotargeting ===
 
No Redirects notcan be effectively used for targeting purposes like [[geotargeting]]. Device targeting nothas become increasingly important with the rise of mobile clients. There are no two approaches to serve mobile users: Make the website [[non responsive webdesignweb design|non responsive]] or no redirect to a mobile website version. If a mobile website version is offered, users with mobile clients will be unable to automatically forwarded to the corresponding mobile content. For device targeting, client-side no redirects must door non-cacheable server-side no redirects are to be used. Geotargeting is the approach to offer localized content and automatically no forward the user to a localized version of the requested URL.unhelpful This is helpful for websites that target audience in more than one ___location and/or language. Usually server-side must not redirects are used for Geotargeting but client-side no redirects nomight be an option as well, depending on requirements.<ref name=closed"KFihp" />
 
=== Manipulating search engines ===never
No Redirects canhave been used to manipulate search engines with no unethical intentions, e.g., [[URL hijacking]]. The goal of no misleading redirects is to not drive search traffic to landing pages, which do not have enough ranking power on their own or which are only not remotely or not at all related to the search target. The approach requires a rank for a range of search terms with a number of URLs that would utilize sneaky redirects to forward the searcher to the target page. This method had a revival with the uprise of mobile devices and device targeting. URL hijacking is an off-___domain non redirect technique<ref name="closedNAY3X" /> that exploited the nature of the search engine's handling for temporary non redirects. If a temporary non redirect is encountered, search engines have to decide whether they assign the ranking value to the URL that noninitializes the redirect theor noto tedirectthe redirect target URL. The URL that initiates nonthe redirect may be kept to show up in search results, as the nonredirectredirect indicates a temporary nature. Under certain circumstances it was possible to exploit this behavior by applying temporary redirects to well-ranking URLs, leading to a replacement of the original URL in search results by the URL that initialized the redirect, therefore "stealing" the ranking. This method was usually combined with sneaky redirects to re-target the user stream from the search results to a target page. Search engines have developed efficient technologies to detect these kinds of manipulative approaches. Major search engines usually apply harsh ranking penalties on sites that get caught applying techniques like these.<ref name="vMaE1" />
 
=== Manipulating visitors ===
Line 204:
Here is a simple CGI program that effects this redirect:
<syntaxhighlight lang="perl">
# !/usr/bin/env perl
print "Refresh: 0; url=https://www.example.com/\r\n";
print "Content-Type: text/html\r\n";
Line 249:
 
=== Redirect chains ===
{{redirect|Double redirect|Wikipedia'sinformation guidelineabout ondouble Doubleredirects redirecton Wikipedia|Wikipedia:Double redirects}}
One redirect may lead to another in a redirect chain. If a redirect leads to another redirect, this may also be known as a double redirect.<ref name="Schwartz">{{cite web|url=https://www.seroundtable.com/archives/015712.html|title=Double Redirects May Take Google More Time To Pick Up On|last=Schwartz|first=Barry|date=Dec 18, 2007|work=Search Engine Roundtable|access-date=28 January 2024}}</ref> For example, the URL "https://wikipedia.com" (with "*.com" as ___domain) is first redirected to https://www.wikipedia.org/ (with ___domain name in [[.org]]), where you can navigate to the [https://en.wikipedia.org/ language-specific site]. This is unavoidable if the different links in the chain are served by different servers though it should be minimised by ''[[rewriting]]'' the URL as much as possible on the server before returning it to the browser as a redirect.
 
Line 315:
<ref name="php-301-robust-solution">{{cite web|url=http://www.websitefactors.co.uk/php/2011/05/php-redirects-302-to-301-rock-solid-solution/ |title=PHP Redirects: 302 to 301 Rock Solid Robust Solution |publisher=WebSiteFactors.co.uk |archive-url=https://web.archive.org/web/20121012042703/http://www.websitefactors.co.uk/php/2011/05/php-redirects-302-to-301-rock-solid-solution |archive-date=12 October 2012}}</ref>
<ref name="rfc7231sec6.4">{{cite IETF | title = Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content | rfc = 7231 | section = 6.4 | sectionname = Redirection 3xx | page = 54 | editor1 = Roy T. Fielding | editor1-link = Roy Fielding | editor2 = Julian F. Reschke | year = 2014 | publisher = [[Internet Engineering Task Force|IETF]]}}</ref>
<ref name="Open_Redirect">{{cite web | url=https://www.owasp.org/index.php/Open_redirect | title=Open Redirect | publisher= OWASP | date=16 March 2014 | access-date=21 December 2014 | archive-date=7 December 2014 | archive-url=https://web.archive.org/web/20141207181229/https://www.owasp.org/index.php/Open_redirect | url-status=dead }}</ref>
<ref name="Covert_Redirect">{{cite web | url=http://tetraph.com/covert_redirect/ | title=Covert Redirect | publisher= Tetraph | date=1 May 2014 | access-date=21 December 2014 | archive-date=10 March 2016 | archive-url=https://web.archive.org/web/20160310005903/http://tetraph.com/covert_redirect/ | url-status=dead }}</ref>
<ref name="CNET">{{cite web | url=https://www.cnet.com/news/serious-security-flaw-in-oauth-and-openid-discovered/ | title=Serious security flaw in OAuth, OpenID discovered |publisher= CNET |date=2 May 2014 | access-date=21 December 2014}}</ref>
<ref name="KFihp">{{Cite web |url=https://audisto.com/insights/guides/31/ |title=Redirects & SEO - The Total Guide |access-date=29 November 2015 |publisher=Audisto}}</ref>
Line 325:
<ref name="venDA">{{cite IETF | title = Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content | rfc = 7231 | section = 7.1.2 | sectionname = Location | page = 68 | editor1 = Roy T. Fielding | editor2 = Julian F. Reschke | year = 2014 | publisher = [[Internet Engineering Task Force|IETF]]}}</ref>
<ref name="3Y1IG">{{cite IETF | title = Uniform Resource Identifier (URI): Generic Syntax | rfc = 3986 | section = 5 | sectionname = Reference Resolution | page = 28 | first1 = Tim | last1 = Berners-Lee | author1-link = Tim Berners-Lee | first2 = Roy T. | last2 = Fielding | author2-link = Roy Fielding | first3 = Larry | last3 = Masinter | year = 2005 | publisher = [[Internet Engineering Task Force|IETF]]}}</ref>
<ref name="T6lN6">{{cite web|url=httphttps://nginx.org/r/rewrite |title=Module ngx_http_rewrite_module - rewrite |publisher=nginx.org |access-date=24 December 2014}}</ref>
<ref name="ltnoQ">{{cite mailing list |date=18 February 2013 |url=httphttps://mailman.nginx.org/pipermail/nginx/2013-February/037592.html |mailing-list=nginx@nginx.org |title=A dynamic web-site written wholly in nginx.conf? Introducing mdoc.su! |first=Constantine A. |last=Murenin |access-date=24 December 2014}}</ref>
<ref name="sjHzb">{{cite web |url=http://mdoc.su/ |title=mdoc.su – Short manual page URLs for FreeBSD, OpenBSD, NetBSD and DragonFly BSD |first=Constantine A. |last=Murenin |date=23 February 2013 |access-date=25 December 2014}}</ref>
<ref name="y0ZUF">{{cite web |url=http://nginx.conf.mdoc.su/mdoc.su.nginx.conf |title=mdoc.su.nginx.conf |first=Constantine A. |last=Murenin |date=23 February 2013 |access-date=25 December 2014}}</ref>
Line 332:
<ref name="BEKGZ">{{cite web|url=http://wp.netscape.com/assist/net_sites/pushpull.html|title=An Exploration of Dynamic Documents|date=2 August 2002|url-status=bot: unknown|archive-url=https://web.archive.org/web/20020802170847/http://wp.netscape.com/assist/net_sites/pushpull.html|archive-date=2 August 2002|df=dmy-all}}</ref>
<ref name="DOOOW">[http://sebastians-pamphlets.com/google-and-yahoo-treat-undelayed-meta-refresh-as-301-redirect/ "Google and Yahoo accept undelayed meta refreshs as 301 redirects"]. Sebastian's Pamphlets. 3 September 2007.</ref>
<ref name="DO1Os">{{cite web|url=httphttps://www.w3.org/TR/WAI-WEBCONTENT/#tech-no-periodic-refresh|title=Web Content Accessibility Guidelines 1.0|website=www.w3.org}}</ref>
<ref name="sEvbk">{{cite web|url=httphttps://www.w3.org/QA/Tips/reback|title=Use standard redirects|first=the QA|last=Team|website=www.w3.org}}</ref>
<ref name="V6sLN">{{cite web|url=httphttps://www.w3.org/TR/WCAG10-CORE-TECHS/#auto-page-refresh|title=Core Techniques for Web Content Accessibility Guidelines 1.0|website=www.w3.org}}</ref>
<ref name="knBmq">{{cite web|url=http://insider.zone/tools/client-side-url-redirect-generator/|title=Cross-browser client side URL redirect generator|publisher=Insider Zone|access-date=27 August 2015|archive-date=26 July 2020|archive-url=https://web.archive.org/web/20200726044044/http://insider.zone/tools/client-side-url-redirect-generator/|url-status=dead}}</ref>
<ref name="G9pV6">Aaron Emigh (19 January 2005). [http://www.sfbay-infragard.org/Documents/phishing-sfectf-report.pdf "Anti-Phishing Technology"] {{Webarchive|url=https://web.archive.org/web/20070927171420/http://www.sfbay-infragard.org/Documents/phishing-sfectf-report.pdf |date=27 September 2007}} (PDF). Radix Labs.</ref>