CINXE.COM
View source for Manual:Short URL - MediaWiki
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-disabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-not-available" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>View source for Manual:Short URL - MediaWiki</title> <script>(function(){var className="client-js vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-disabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-not-available";var cookie=document.cookie.match(/(?:^|; )mediawikiwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":true,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"14b47265-ffef-4b16-890c-135e3824bedd","wgCanonicalNamespace":"Manual","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":100,"wgPageName":"Manual:Short_URL","wgTitle":"Short URL","wgCurRevisionId":6808220,"wgRevisionId":0,"wgArticleId":7060,"wgIsArticle":false,"wgIsRedirect":false,"wgAction":"edit","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Manual:Short_URL","wgRelevantArticleId":7060,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":["autoconfirmed"],"wgRestrictionMove":["autoconfirmed"],"wgNoticeProject":"mediawiki","wgCiteReferencePreviewsActive":true,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgVisualEditor":{ "pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":20000,"wgTranslatePageTranslation":"source","wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"personal","wgULSisCompactLinksEnabled":true,"wgVector2022LanguageInHeader":false,"wgULSisLanguageSelectorEmpty":false,"wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"]};RLSTATE={"ext.gadget.CharInsertButtons":"ready","ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.translate.edit.documentation.styles":"ready","ext.translate": "ready","ext.charinsert.styles":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.pt":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.CodeMirror.v6.WikiEditor.init","mediawiki.action.edit.collapsibleFooter","site","mediawiki.page.ready","skins.vector.js","ext.centralNotice.geoIP","ext.translate.pagetranslation.uls","ext.charinsert","ext.gadget.Edittools","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.compactlinks","ext.uls.interface","ext.checkUser.clientHints"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.charinsert.styles%7Cext.translate%2CwikimediaBadges%7Cext.translate.edit.documentation.styles%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.gadget.CharInsertButtons&only=styles&skin=vector-2022"> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.5"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="noindex,nofollow,max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:site_name" content="MediaWiki"> <meta property="og:title" content="View source for Manual:Short URL - MediaWiki"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//m.mediawiki.org/wiki/Manual:Short_URL"> <link rel="apple-touch-icon" href="/static/apple-touch/mediawiki.png"> <link rel="icon" href="/static/favicon/mediawiki.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="MediaWiki (en)"> <link rel="EditURI" type="application/rsd+xml" href="//www.mediawiki.org/w/api.php?action=rsd"> <link rel="canonical" href="https://www.mediawiki.org/wiki/Manual:Short_URL"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"> <link rel="alternate" type="application/atom+xml" title="MediaWiki Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-100 ns-subject page-Manual_Short_URL rootpage-Manual_Short_URL skin-vector-2022 action-edit"><a class="mw-jump-link" href="#bodyContent">Jump to content</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Main menu" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Main menu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Main menu</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">hide</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/MediaWiki" title="Visit the main page [z]" accesskey="z"><span>Main page</span></a></li><li id="n-mw-download" class="mw-list-item"><a href="/wiki/Download"><span>Get MediaWiki</span></a></li><li id="n-mw-extensions" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Category:Extensions"><span>Get extensions</span></a></li><li id="n-blog-text" class="mw-list-item"><a href="https://techblog.wikimedia.org/"><span>Tech blog</span></a></li><li id="n-mw-contribute" class="mw-list-item"><a href="/wiki/Special:MyLanguage/How_to_contribute"><span>Contribute</span></a></li> </ul> </div> </div> <div id="p-support" class="vector-menu mw-portlet mw-portlet-support" > <div class="vector-menu-heading"> Support </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Help:Contents" title="The place to find out"><span>User help</span></a></li><li id="n-mw-faq" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Manual:FAQ"><span>FAQ</span></a></li><li id="n-mw-manual" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Manual:Contents"><span>Technical manual</span></a></li><li id="n-mw-supportdesk" class="mw-list-item"><a href="/wiki/Project:Support_desk"><span>Support desk</span></a></li><li id="n-mw-communication" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Communication"><span>Communication</span></a></li> </ul> </div> </div> <div id="p-development" class="vector-menu mw-portlet mw-portlet-development" > <div class="vector-menu-heading"> Development </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mw-developerportal" class="mw-list-item"><a href="https://developer.wikimedia.org/"><span>Developer portal</span></a></li><li id="n-svn-statistics" class="mw-list-item"><a href="/wiki/Development_statistics"><span>Code statistics</span></a></li> </ul> </div> </div> <div id="p-mediawiki.org" class="vector-menu mw-portlet mw-portlet-mediawiki_org" > <div class="vector-menu-heading"> mediawiki.org </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-portal" class="mw-list-item"><a href="/wiki/Project:Help" title="About the project, what you can do, where to find things"><span>Community portal</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:RecentChanges" title="A list of recent changes in the wiki [r]" accesskey="r"><span>Recent changes</span></a></li><li id="n-mw-translate" class="mw-list-item"><a href="/wiki/Special:LanguageStats"><span>Translate content</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Special:Random" title="Load a random page [x]" accesskey="x"><span>Random page</span></a></li><li id="n-mw-discussion" class="mw-list-item"><a href="/wiki/Project:Village_Pump"><span>Village pump</span></a></li><li id="n-Sandboxlink-portlet-label" class="mw-list-item"><a href="/wiki/Project:Sandbox"><span>Sandbox</span></a></li> </ul> </div> </div> <div id="vector-main-menu" class="vector-menu " > <div class="vector-menu-heading"> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/MediaWiki" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/mediawikiwiki.svg" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="MediaWiki" src="/static/images/mobile/copyright/mediawikiwiki-wordmark.svg" style="width: 7.5em; height: 1.125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Special:Search" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Search MediaWiki [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Search</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Search MediaWiki" aria-label="Search MediaWiki" autocapitalize="sentences" title="Search MediaWiki [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Special:Search"> </div> <button class="cdx-button cdx-search-input__end-button">Search</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Personal tools"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-uls" class="mw-list-item active user-links-collapsible-item"><a data-mw="interface" href="#" class="uls-trigger cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet"><span class="vector-icon mw-ui-icon-wikimedia-language mw-ui-icon-wikimedia-wikimedia-language"></span> <span>English</span></a> </li> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page's font size, width, and color" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Appearance" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Appearance</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign=www.mediawiki.org&uselang=en" class=""><span>Donate</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:CreateAccount&returnto=Manual%3AShort+URL&returntoquery=action%3Dedit" title="You are encouraged to create an account and log in; however, it is not mandatory" class=""><span>Create account</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:UserLogin&returnto=Manual%3AShort+URL&returntoquery=action%3Dedit" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o" class=""><span>Log in</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="More options" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Personal tools" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Personal tools</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="User menu" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign=www.mediawiki.org&uselang=en"><span>Donate</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:CreateAccount&returnto=Manual%3AShort+URL&returntoquery=action%3Dedit" title="You are encouraged to create an account and log in; however, it is not mandatory"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Create account</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:UserLogin&returnto=Manual%3AShort+URL&returntoquery=action%3Dedit" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Log in</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Pages for logged out editors <a href="/wiki/Help:Introduction" aria-label="Learn more about editing"><span>learn more</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [y]" accesskey="y"><span>Contributions</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [n]" accesskey="n"><span>Talk</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <h1 id="firstHeading" class="firstHeading mw-first-heading">View source for Manual:Short URL</h1> <div class="mw-indicators"> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Namespaces"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-manual" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Manual:Short_URL" title="View the subject page [c]" accesskey="c"><span>Manual</span></a></li><li id="ca-talk" class="vector-tab-noicon mw-list-item"><a href="/wiki/Manual_talk:Short_URL" rel="discussion" title="Discussion about the content page [t]" accesskey="t"><span>Discussion</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Change language variant" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">English</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Views"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="vector-tab-noicon mw-list-item"><a href="/wiki/Manual:Short_URL"><span>Read</span></a></li><li id="ca-viewsource" class="selected vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Manual:Short_URL&action=edit" title="This page is protected. You can view its source [e]" accesskey="e"><span>View source</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Manual:Short_URL&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Tools" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Tools</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Tools</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">hide</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="More options" > <div class="vector-menu-heading"> Actions </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="vector-more-collapsible-item mw-list-item"><a href="/wiki/Manual:Short_URL"><span>Read</span></a></li><li id="ca-more-viewsource" class="selected vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Manual:Short_URL&action=edit"><span>View source</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Manual:Short_URL&action=history"><span>View history</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> General </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/Manual:Short_URL" title="A list of all wiki pages that link here [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/Manual:Short_URL" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-upload" class="mw-list-item"><a href="//commons.wikimedia.org/wiki/Special:UploadWizard" title="Upload files [u]" accesskey="u"><span>Upload file</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Manual:Short_URL&action=info" title="More information about this page"><span>Page information</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlShortener&url=https%3A%2F%2Fwww.mediawiki.org%2Fw%2Findex.php%3Ftitle%3DManual%3AShort_URL%26action%3Dedit"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&url=https%3A%2F%2Fwww.mediawiki.org%2Fw%2Findex.php%3Ftitle%3DManual%3AShort_URL%26action%3Dedit"><span>Download QR code</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects emptyPortlet" > <div class="vector-menu-heading"> In other projects </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Appearance</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">hide</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> </div> <div id="contentSub"><div id="mw-content-subtitle">← <a href="/wiki/Manual:Short_URL" title="Manual:Short URL">Manual:Short URL</a></div></div> <div id="mw-content-text" class="mw-body-content"><p>You do not have permission to edit this page, for the following reasons: </p> <ul class="permissions-errors"><li class="mw-permissionerror-protectedpagetext"><style data-mw-deduplicate="TemplateStyles:r6611795">.mw-parser-output th.mbox-text,.mw-parser-output td.mbox-text{padding:0.25em 0.9em}.mw-parser-output td.mbox-image{padding:2px 0 2px 0.9em}.mw-parser-output td.mbox-imageright{padding:2px 0.9em 2px 0}.mw-parser-output table.fmbox{clear:both;margin:0.2em 0;width:100%;border:1px solid #a2a9b1;background-color:var(--background-color-interactive-subtle,#f8f9fa);color:var(--color-base,#202122);box-sizing:border-box}.mw-parser-output table.fmbox-system{background-color:var(--background-color-interactive-subtle,#f8f9fa)}.mw-parser-output table.fmbox-warning{border:1px solid #bb7070;background-color:#ffdbdb;color:#333}.mw-parser-output table.fmbox-editnotice{background-color:transparent}</style><div class="mw-parser-output"><table id="mw-semiprotectedpagetext" class="fmbox fmbox-system plainlinks" role="presentation" style="border-style:none;"><tbody><tr><td class="mbox-text"><style data-mw-deduplicate="TemplateStyles:r6651108">.mw-parser-output table.ombox{margin:4px 10%;border-collapse:collapse;border:1px solid #a2a9b1;background-color:#f8f9fa;color:#333;box-sizing:border-box}.mw-parser-output .ombox td.mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ombox th.mbox-text,.mw-parser-output .ombox td.mbox-text{border:none;padding:0.25em 0.9em;width:100%}.mw-parser-output .ombox td.mbox-image{border:none;text-align:center;padding:2px 0 2px 0.9em}.mw-parser-output .ombox td.mbox-imageright{border:none;text-align:center;padding:2px 0.9em 2px 0}.mw-parser-output table.ombox-notice{border-color:#a2a9b1}.mw-parser-output table.ombox-speedy{background-color:#fee7e6;color:#333}.mw-parser-output table.ombox-speedy,.mw-parser-output table.ombox-delete{border-color:#b32424;border-width:2px}.mw-parser-output table.ombox-content{border-color:#f28500}.mw-parser-output table.ombox-style{border-color:#fc3}.mw-parser-output table.ombox-move{border-color:#9932cc}.mw-parser-output table.ombox-protection{border-color:#a2a9b1;border-width:2px}html body.mediawiki .mw-parser-output .ombox.mbox-small{clear:right;float:right;margin:4px 0 4px 1em;box-sizing:border-box;width:238px;font-size:88%;line-height:1.25em}@media screen{html.skin-theme-clientpref-night .mw-parser-output table.ombox{background-color:transparent;color:inherit}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output table.ombox{background-color:transparent;color:inherit}}</style><table class="ombox ombox-protection plainlinks" role="presentation"><tbody><tr><td class="mbox-image"><span typeof="mw:File"><span><img alt="Padelock" src="//upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Semi-protection-shackle.svg/40px-Semi-protection-shackle.svg.png" decoding="async" width="40" height="40" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Semi-protection-shackle.svg/60px-Semi-protection-shackle.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Semi-protection-shackle.svg/80px-Semi-protection-shackle.svg.png 2x" data-file-width="512" data-file-height="512" /></span></span></td><td class="mbox-text" style="font-weight:bold;font-size:130%;">This page is currently semi-protected and can be edited only by established registered users.</td></tr></tbody></table> <table class="wikitable" width="100%"> <tbody><tr> <th>Why is the page protected?</th> <th>What can I do?</th> </tr> <tr style="vertical-align:top;"> <td style="width:35%;"> <ul> <li> While most pages can be edited or translated by anyone, semi-protection is sometimes necessary to prevent vandalism to popular pages.</li> <li> The reason for protection can be found in the <a class="external text" href="https://www.mediawiki.org/w/index.php?title=Special:Log&type=protect&page=Manual:Short_URL">protection log</a>. If there are no relevant entries in the protection log, the page may <a class="external text" href="https://www.mediawiki.org/w/index.php?title=Special:Log&type=move&page=Manual:Short_URL">have been moved</a> after being protected.</li> <li> You might be in the wrong place; MediaWiki is <b>not</b> Wikipedia, Wikibooks or any other Wikimedia project. </li> </ul> </td> <td><ul><li> If you have a user account, <a href="/wiki/Special:UserLogin" title="Special:UserLogin">log in</a> first. If you do not yet have an account, you may <a class="external text" href="https://www.mediawiki.org/w/index.php?title=Special:UserLogin&type=signup">create one</a>; after 4 days, you will be able to edit semi-protected pages.</li> <li><a href="/wiki/Manual_talk:Short_URL" title="Manual talk:Short URL">Discuss this page</a> with others.</li> <li><a href="/wiki/Project:Village_Pump" title="Project:Village Pump">Request unprotection</a> of the page.</li> <li>Check <a href="/wiki/Project:About" title="Project:About">Project:About</a> to find out what this site is about. </li> </ul> </td> </tr> </tbody></table></td></tr></tbody></table></div></li><li class="mw-permissionerror-globalblocking-blockedtext-range"><b>Your IP address is in a range that has been <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/Global_blocks" class="extiw" title="m:Special:MyLanguage/Global blocks">blocked on all Wikimedia Foundation wikis</a>.</b> <p>The block was made by <a href="/wiki/User:Jon_Kolbert" title="User:Jon Kolbert">Jon Kolbert</a>. The reason given is <i><a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/NOP" class="extiw" title="m:Special:MyLanguage/NOP">Open proxy/Webhost</a>: See the <a href="https://meta.wikimedia.org/wiki/WM:OP/H" class="extiw" title="m:WM:OP/H">help page</a> if you are affected </i>. </p> <ul><li>Start of block: 15:12, 27 August 2023</li> <li>Expiry of block: 15:12, 27 August 2028</li></ul> <p>Your current IP address is 8.222.208.146. The blocked range is 8.222.128.0/17. </p><p>Please include all above details in any queries you make. If you believe you were blocked by mistake, you can find additional information and instructions in the <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/No_open_proxies" class="extiw" title="m:Special:MyLanguage/No open proxies">No open proxies</a> global policy. </p> Otherwise, to discuss the block please <a href="https://meta.wikimedia.org/wiki/Steward_requests/Global" class="extiw" title="m:Steward requests/Global">post a request for review on Meta-Wiki</a>. You could also send an email to the <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/Stewards" class="extiw" title="m:Special:MyLanguage/Stewards">stewards</a> <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/VRT" class="extiw" title="m:Special:MyLanguage/VRT">VRT</a> queue at <kbd>stewards@wikimedia.org</kbd> including all above details.</li></ul><hr /> <p>You can view and copy the source of this page. </p><textarea readonly="" accesskey="," id="wpTextbox1" cols="80" rows="25" style="" class="mw-editfont-monospace" lang="en" dir="ltr" name="wpTextbox1"><languages/> {{Hatnote|1=<translate><!--T:132--> This article is about URL structure.</translate> <translate><!--T:133--> For creating short URLs for articles, see <tvar name=1>{{ll|Extension:ShortUrl}}</tvar>.</translate> <translate><!--T:134--> For creating a URL shortening service, see <tvar name=1>{{ll|Extension:UrlShortener}}</tvar>.</translate>}} {{TOC|align=right}} <translate><!--T:1--> '''Short URLs''' or '''URL Rewrites''' hide php file extensions from the page address.</translate> <translate><!--T:2--> Please take a few minutes to devise a stable URL structure for your website before getting started, to reduce problems later.</translate> <translate> == Introduction == <!--T:3--> === Goal === <!--T:4--> <!--T:5--> The default MediaWiki installation path looks like this: </translate> : <code>/var/www/html/mediawiki</code> ''<translate><!--T:6--> (installed as root user)</translate>'' : <code>/home/johndoe/public_html/mediawiki</code> ''<translate><!--T:7--> (installed with a shared hosting provider)</translate>'' <translate> <!--T:8--> MediaWiki's default page addresses looks like these examples: </translate> : <code><nowiki>https://example.org/w/index.php/Page_title</nowiki></code> ''<translate><!--T:9--> (recent versions of MediaWiki, without [[w:Common Gateway Interface|CGI]] support)</translate>'' : <code><nowiki>https://example.org/w/index.php?title=Page_title</nowiki></code> ''<translate><!--T:10--> (recent versions of MediaWiki, with CGI support)</translate>'' <translate> <!--T:11--> Using the methods outlined on this page, we can configure something like this: </translate> : <code><nowiki>https://example.org/wiki/Page_title</nowiki></code> <translate><!--T:12--> This is the most common configuration, same as on Wikipedia, though not the default because it requires server-side modifications</translate> : <code><nowiki>https://example.org/view/Page_title</nowiki></code> : <code><nowiki>https://wiki.example.org/view/Page_title</nowiki></code> : <code><nowiki>https://example.org/Page_title</nowiki></code> : <code><nowiki>https://wiki.example.org/Page_title</nowiki></code> <translate><!--T:136--> Some people do not recommend the last two configurations.</translate> <translate><!--T:137--> See <tvar name=1>{{ll|Manual:Wiki in site root directory}}</tvar> for potential problems and solutions.</translate> <translate> === Advantages & disadvantages === <!--T:17--> <!--T:18--> * '''Advantage''': Short URLs hide some technical details from end-users, which can be desirable for site owners. Among other things, this means they can be kept stable when the underlying software changes.</translate> <translate><!--T:127--> (See above for the difference between MediaWiki's default URL structure with CGI enabled vs without.)</translate> <translate><!--T:19--> They are also easier to read, remember, and manipulate for visitors.</translate> <translate><!--T:20--> Additionally, short URLs offer an advantage over the default URLs for [[w:Search engine optimization]], as URLs containing <code>?</code> can be treated less favorably by search engines when calculating page rank.</translate> <translate> <!--T:21--> * '''Disadvantage''': Requires configuration, so, depending on the hosting environment you are using, it might be difficult to recreate.</translate> <translate><!--T:22--> However, as every widely used webserver is capable of being configured to use short URLs, most paid web hosting services should support this feature. Any host that doesn't offer you this feature is not worth your money.</translate> <translate> == Guides == <!--T:23--> </translate> <translate><!--T:24--> Our official guides for short URL configuration for different web servers.</translate> <translate><!--T:25--> Pick your web server's configuration from this list.</translate> <translate><!--T:26--> If you don't know what server software you are using, then it is most likely Apache.</translate> * {{ll|Manual:Short URL/Apache|Apache}} (<translate><!--T:135--> or</translate> LiteSpeed) * {{ll|Manual:Short URL/Nginx|nginx}} * {{ll|Manual:Short URL/Docker|Docker}} <translate> == Other how-to mini-guides == <!--T:28--> </translate> {{note|text=<translate><!--T:29--> These guides are old and are almost entirely bad advice.</translate> <translate><!--T:30--> These will eventually be deleted one by one as our official guides above are created for different webservers.</translate>}} <translate><!--T:31--> Anyone is welcome to create a how-to solution page and list it below.</translate> <translate><!--T:32--> Please use a sensible name for the page, one that fits in with the below names.</translate> <translate><!--T:33--> When each unique solution has its own page, readers can skip complexity they do not want.</translate> <translate><!--T:34--> Keep it simple, readable, short, with a separate page per separate solution.</translate> <translate> <!--T:35--> '''To help others find out which Short URL methods really work, after trying each method please edit the page and increase the "worked" or "didn't_work" numbers for that guide and make a brief (or long, your choice) description on what went wrong by clicking the link on your number.''' === URL like - example.com/wiki/Page_title === <!--T:36--> </translate> {{Note|1=<translate><!--T:38--> Actions such as edit, view history, etc. will still have index.php unless <tvar name=1>{{ll|Manual:$wgActionPaths|$wgActionPaths}}</tvar> are defined.</translate>}} <translate> ==== Root access ==== <!--T:39--> </translate> <translate><!--T:40--> These methods require that you have access to the server configuration.</translate> <translate><!--T:41--> If you are on a shared host, you most likely don't.</translate> <translate><!--T:42--> In this case you will be required to use a method that requires "no root access".</translate> <translate><!--T:43--> You can jump directly to the [https://shorturls.redwerks.org/ MediaWiki ShortURL Builder tool] and follow the on-screen instructions.</translate> <translate><!--T:131--> Select "I don't have root access" after entering your wiki's URL.</translate> {{guide |name=wiki/Page title -- Lighttpd rewrite--root access |show=<translate nowrap><!--T:45--> wiki/Page title -- Lighttpd rewrite--root access</translate> |worked=3 |didn't_work=0 }} {{guide |name=wiki/Page title -- Cherokee rewrite--root access |show=<translate nowrap><!--T:49--> wiki/Page title -- Cherokee rewrite--root access</translate> |worked=1 |didn't_work=0}} {{guide |name=IIS8.5 |worked=2 |didn't_work=1}} {{guide |name=Abyss|Abyss Web Server X2}} <translate> <!--T:55--> (for Apache guidance, see the link in the [[<tvar name=guides>#Guides</tvar>|Guides]] section). </translate> {{anchor|URL like}} <translate> === URL like - example.com/Page_title === <!--T:56--> </translate> {{wiki-in-docroot}} <translate> <!--T:57--> How to create <code>example.com/Page_title</code> URLs: </translate> {{guide |name=Page title - nginx, Root Access, PHP as a CGI module |show=<translate nowrap><!--T:59--> Page title - nginx, Root Access, PHP as a CGI module</translate> |worked=6 |didn't_work=}} {{guide |name=Page title -- Windows & Apache without 403 on Special Pages |show=<translate nowrap><!--T:61--> Page title -- Windows & Apache without 403 on Special Pages</translate> |worked=3 |didn't_work=}} {{anchor|URL like subdomain}} <translate> === URL like - wiki.example.com/Page_title === <!--T:64--> </translate> {{wiki-in-docroot}} <translate> <!--T:65--> How to create <code>wiki.example.com/Page_title</code> URLs: </translate> {{guide |name=wiki.example.com/Page_title--Subdomain using Lighttpd |show=<translate nowrap><!--T:67--> wiki.example.com/Page_title--Subdomain using Lighttpd</translate> |worked=0 |didn't_work=0 }} <translate> == Troubleshooting == <!--T:68--> === Ampersand (&) problem === <!--T:69--> </translate> <translate><!--T:70--> The ampersand problem shows up when you have page titles with symbols in them (such as &, ?, #, + and /) which, despite being correctly encoded in the link, are not being passed correctly from mod_rewrite to the script.</translate> <translate><!--T:71--> This manifests in 404 page-not-found errors, because the title gets cut off at the special character.</translate> <translate><!--T:72--> For example, clicking on a link to "John & Maria's page" gets a 404, because MediaWiki is looking for a page named "John ".</translate> <translate><!--T:73--> This is because ampersands in long-form names are treated as [[w:Query string|query string]] separators, and would never reach the PHP [[w:Run time (program lifecycle phase)|runtime environment]].</translate> <translate><!--T:74--> This is caused by an old and problematic mod_rewrite bug.<ref>[https://bz.apache.org/bugzilla/show_bug.cgi?id=34602 Bugzilla mod_rewrite for ampersand bug], partially resolved for some users, but only after 13 years</ref></translate> <translate> <!--T:75--> '''Solution:''' </translate> <translate><!--T:76--> This issue is caused by the <code>?title=$1</code> portion of rewrite rules like <code>/index.php?title=$1</code> which is completely unnecessary and harmful.</translate> <translate><!--T:77--> MediaWiki parses paths directly from the REQUEST_URI, so rewrite everything to /index.php.</translate> <translate> === Purging cache === <!--T:84--> <!--T:85--> If you notice that your changes to <tvar name=1><code>$wgArticlePath</code></tvar> in <tvar name=2><code>LocalSettings.php</code></tvar> are not being reflected in <tvar name=3><code>example.com/wiki/Main_Page</code></tvar>, it may be due to MediaWiki's caching of the links according to previous settings. <!--T:86--> Go to <tvar name=1><code>example.com/wiki/Main_Page?action=purge</code></tvar> to force MediaWiki to regenerate the cached links. <!--T:87--> Also you can: <!--T:88--> # execute the MySQL query "TRUNCATE objectcache;", or</translate> <translate> <!--T:89--> # Ensure <tvar name=2>{{wg|CacheEpoch}}</tvar> is updated (if <tvar name=3>{{wg|InvalidateCacheOnLocalSettingsChange}}</tvar> is enabled, all you have to do is edit <tvar name=1>{{ll|Manual:LocalSettings.php|LocalSettings.php}}</tvar> to purge it) == Redirect visitor of your domain to your wiki == <!--T:90--> <!--T:91--> Our official guides for short url configuration include recommendations on how to point the root of your site to your wiki using your short url config. <!--T:92--> For example our [[<tvar name=1>Special:MyLanguage/Manual:Short URL/Apache</tvar>|Apache guide]] recommends using this to point your site root to your wiki: </translate> <syntaxhighlight lang="apache"> RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L] </syntaxhighlight> <translate><!--T:93--> Note that we do '''not''' recommend doing a HTTP redirect to your wiki path or main page directly.</translate> <translate><!--T:94--> As redirecting to the main page directly will hard-code variable parts of your wiki's page setup into your server config.</translate> <translate><!--T:95--> And redirecting to the wiki path will result in two redirects.</translate> <translate><!--T:96--> Simply rewrite the root path to MediaWiki and it will take care of the 301 redirect to the main page itself.</translate> <translate> <!--T:97--> If using VirtualHosts, place the rewrite rules into the virtual host declaration! == Moving a wiki from /wiki to /w == <!--T:98--> </translate> <translate><!--T:99--> A common beginner's mistake is to install MediaWiki itself (the source code, not the short URL) in <code>/wiki</code> instead of <code>/w</code>.</translate> <translate><!--T:100--> Once installed they would realize the mistake when trying to configure Short URLs (which would become difficult as the virtual path then conflicts with the real path).</translate> <translate> <!--T:101--> There is a manual for [[<tvar name=1>Special:MyLanguage/Manual:Moving a wiki</tvar>|moving a wiki]] in general, however that is too complicated if all you need is to change the installation directory (and stay on the same server, same database and same hostname). <!--T:102--> Here is what you have to do: <!--T:103--> * Backup <tvar name=1><code>LocalSettings.php</code></tvar> and any other config files you may have created (such as your <tvar name=2><code>.htaccess</code></tvar>).</translate> <translate> <!--T:104--> * Rename the installation directory of MediaWiki on your server from <code>/wiki</code> to <code>/w</code>.</translate> <translate> <!--T:105--> * Set <tvar name=1><code>$wgScriptPath</code></tvar> in <tvar name=2><code>LocalSettings.php</code></tvar> to <tvar name=3><code>"/w"</code></tvar> and remove (or comment out) any definition of <tvar name=4><code>$wgArticlePath</code></tvar> (this variable will be changed again when setting up Short URLs, further on)</translate> <translate> <!--T:106--> * At this point your wiki should be working normally at <code>example.org/w</code></translate> <translate> <!--T:107--> * Now go through [[<tvar name=guides>#Guides</tvar>|the regular guide]] to set up short URLs</translate> <translate> <!--T:108--> * Perform a few tests on your wiki to make sure nothing is broken.</translate> <translate><!--T:109--> Edit a page, visit a few different pages, etc.</translate> <translate><!--T:110--> If anything seems abnormal, revert the changes by restoring your backup of <tvar name=1><code>LocalSettings.php</code></tvar> and other relevant files you might have changed during configuration of short URLs and rename your folder back to <tvar name=2><code>/wiki</code></tvar>.</translate> <translate><!--T:111--> '''Note for shared hosting users:''' Many shared hosting plans offer an application manager to automatically Install, Update and Backup applications such as MediaWiki.</translate> <translate><!--T:112--> If your plan has this and if you want to keep using these features, you should contact their tech support and let them know you just manually changed your MediaWiki installation directory.</translate> <translate> == Tricks == <!--T:113--> </translate> {{guide |name=Prevent bots from crawling index.php |show=<translate nowrap><!--T:116--> Prevent bots from crawling index.php</translate> |worked=0 |didn't_work=0 }} <translate> == See also == <!--T:117--> <!--T:118--> *[[w:Common Gateway Interface#Workarounds for scripting languages|Explanation of what CGI modules are]] </translate> *{{ll|Manual:$wgUsePathInfo|$wgUsePathInfo}} - <translate><!--T:119--> configuration setting that defines whether to use 'pretty' URLs or not</translate> <translate> <!--T:120--> *[[<tvar name=1>Special:MyLanguage/Manual:Wiki in site root directory</tvar>|Notes on placing your wiki installation in site root directory]]</translate> *{{ll|Manual:$wgActionPaths|$wgActionPaths}} - <translate><!--T:121--> configuration setting that you can use to define 'pretty' URLs for other actions, like edit or history</translate> <translate> <!--T:122--> * [[<tvar name=1>Special:MyLanguage/Requests for comment/Clean up URLs</tvar>|Clean up URLs RFC]] - proposes "cleaner URLs for editing, previewing skins, etc." == External links == <!--T:123--> <!--T:124--> *[https://httpd.apache.org/docs/current/mod/mod_rewrite.html Apache Module mod_rewrite] - rewrite requested URLs on the fly</translate> <translate> <!--T:125--> *[https://shorturls.redwerks.org/ MediaWiki Short URL Builder Tool] - ''A tool that can automatically generate a short url configuration more reliably than the configurations in these manual pages.''</translate> <translate> <!--T:128--> * [https://www.nngroup.com/articles/url-as-ui/ URL as UI] by [[w:Jakob Nielsen|Jakob Nielsen]] on the importance of persistent, usable URLs. == References == <!--T:126--> </translate> <references/> <!--these notes are of a technical nature that the average user does not need--> [[Category:Configure{{#translation:}}|{{PAGENAME}}]] [[Category:Wiki page URLs{{#translation:}}|{{PAGENAME}}]] </textarea><div class="templatesUsed"><div class="mw-templatesUsedExplanation"><p>Templates used on this page: </p></div><ul> <li><a href="/wiki/Template:Anchor" title="Template:Anchor">Template:Anchor</a> (<a href="/w/index.php?title=Template:Anchor&action=edit" title="Template:Anchor">view source</a>) (semi-protected)</li><li><a href="/wiki/Template:Guide" title="Template:Guide">Template:Guide</a> (<a href="/w/index.php?title=Template:Guide&action=edit" title="Template:Guide">edit</a>) </li><li><a href="/wiki/Template:Hatnote" title="Template:Hatnote">Template:Hatnote</a> (<a href="/w/index.php?title=Template:Hatnote&action=edit" title="Template:Hatnote">edit</a>) </li><li><a href="/wiki/Template:Hatnote/styles.css" title="Template:Hatnote/styles.css">Template:Hatnote/styles.css</a> (<a href="/w/index.php?title=Template:Hatnote/styles.css&action=edit" title="Template:Hatnote/styles.css">edit</a>) </li><li><a href="/wiki/Template:Ll" class="mw-redirect" title="Template:Ll">Template:Ll</a> (<a href="/w/index.php?title=Template:Ll&action=edit" class="mw-redirect" title="Template:Ll">view source</a>) (protected)</li><li><a href="/wiki/Template:Localized_link" title="Template:Localized link">Template:Localized link</a> (<a href="/w/index.php?title=Template:Localized_link&action=edit" title="Template:Localized link">view source</a>) (protected)</li><li><a href="/wiki/Template:Note" title="Template:Note">Template:Note</a> (<a href="/w/index.php?title=Template:Note&action=edit" title="Template:Note">view source</a>) (protected)</li><li><a href="/wiki/Template:Note/en" title="Template:Note/en">Template:Note/en</a> (<a href="/w/index.php?title=Template:Note/en&action=edit" title="Template:Note/en">edit</a>) </li><li><a href="/wiki/Template:Note/styles.css" title="Template:Note/styles.css">Template:Note/styles.css</a> (<a href="/w/index.php?title=Template:Note/styles.css&action=edit" title="Template:Note/styles.css">view source</a>) (protected)</li><li><a href="/wiki/Template:Pagelang" title="Template:Pagelang">Template:Pagelang</a> (<a href="/w/index.php?title=Template:Pagelang&action=edit" title="Template:Pagelang">view source</a>) (protected)</li><li><a href="/wiki/Template:TNTN" class="mw-redirect" title="Template:TNTN">Template:TNTN</a> (<a href="/w/index.php?title=Template:TNTN&action=edit" class="mw-redirect" title="Template:TNTN">view source</a>) (semi-protected)</li><li><a href="/wiki/Template:TOC" title="Template:TOC">Template:TOC</a> (<a href="/w/index.php?title=Template:TOC&action=edit" title="Template:TOC">view source</a>) (semi-protected)</li><li><a href="/wiki/Template:Translatable" title="Template:Translatable">Template:Translatable</a> (<a href="/w/index.php?title=Template:Translatable&action=edit" title="Template:Translatable">view source</a>) (protected)</li><li><a href="/wiki/Template:Translatable/en" title="Template:Translatable/en">Template:Translatable/en</a> (<a href="/w/index.php?title=Template:Translatable/en&action=edit" title="Template:Translatable/en">edit</a>) </li><li><a href="/wiki/Template:Translatable_template_name" title="Template:Translatable template name">Template:Translatable template name</a> (<a href="/w/index.php?title=Template:Translatable_template_name&action=edit" title="Template:Translatable template name">view source</a>) (semi-protected)</li><li><a href="/wiki/Template:Wg" title="Template:Wg">Template:Wg</a> (<a href="/w/index.php?title=Template:Wg&action=edit" title="Template:Wg">edit</a>) </li><li><a href="/wiki/Template:Wiki-in-docroot" title="Template:Wiki-in-docroot">Template:Wiki-in-docroot</a> (<a href="/w/index.php?title=Template:Wiki-in-docroot&action=edit" title="Template:Wiki-in-docroot">edit</a>) </li><li><a href="/wiki/Template:Wiki-in-docroot/en" title="Template:Wiki-in-docroot/en">Template:Wiki-in-docroot/en</a> (<a href="/w/index.php?title=Template:Wiki-in-docroot/en&action=edit" title="Template:Wiki-in-docroot/en">edit</a>) </li><li><a href="/wiki/Module:Loops" title="Module:Loops">Module:Loops</a> (<a href="/w/index.php?title=Module:Loops&action=edit" title="Module:Loops">view source</a>) (semi-protected)</li><li><a href="/wiki/Module:TableTools" title="Module:TableTools">Module:TableTools</a> (<a href="/w/index.php?title=Module:TableTools&action=edit" title="Module:TableTools">view source</a>) (protected)</li><li><a href="/wiki/Module:Template_translation" title="Module:Template translation">Module:Template translation</a> (<a href="/w/index.php?title=Module:Template_translation&action=edit" title="Module:Template translation">view source</a>) (protected)</li><li><a href="/wiki/Translations:Extension:ShortUrl/Page_display_title/en" title="Translations:Extension:ShortUrl/Page display title/en">Translations:Extension:ShortUrl/Page display title/en</a> (<a href="/w/index.php?title=Translations:Extension:ShortUrl/Page_display_title/en&action=edit" title="Translations:Extension:ShortUrl/Page display title/en">edit</a>) </li><li><a href="/wiki/Translations:Extension:UrlShortener/Page_display_title/en" title="Translations:Extension:UrlShortener/Page display title/en">Translations:Extension:UrlShortener/Page display title/en</a> (<a href="/w/index.php?title=Translations:Extension:UrlShortener/Page_display_title/en&action=edit" title="Translations:Extension:UrlShortener/Page display title/en">edit</a>) </li></ul></div><p id="mw-returnto">Return to <a href="/wiki/Manual:Short_URL" title="Manual:Short URL">Manual:Short URL</a>.</p> <!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://www.mediawiki.org/wiki/Manual:Short_URL">https://www.mediawiki.org/wiki/Manual:Short_URL</a>"</div></div> <div id="catlinks" class="catlinks catlinks-allhidden" data-mw="interface"></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="/wiki/Project:About">About mediawiki.org</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Project:General_disclaimer">Disclaimers</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/www.mediawiki.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-mobileview"><a href="//m.mediawiki.org/w/index.php?title=Manual:Short_URL&action=edit&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-57488d5c7d-qd6jg","wgBackendResponseTime":204,"wgPageParseReport":{"limitreport":{"cputime":"0.052","walltime":"0.063","ppvisitednodes":{"value":80,"limit":1000000},"postexpandincludesize":{"value":7938,"limit":2097152},"templateargumentsize":{"value":0,"limit":2097152},"expansiondepth":{"value":7,"limit":100},"expensivefunctioncount":{"value":0,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":2364,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 46.738 1 -total","100.00% 46.738 1 Template:Fmbox"," 36.29% 16.961 1 Template:Mbox"]},"scribunto":{"limitreport-timeusage":{"value":"0.029","limit":"10.000"},"limitreport-memusage":{"value":747200,"limit":52428800}},"cachereport":{"origin":"mw-web.codfw.main-57488d5c7d-qd6jg","timestamp":"20241128002918","ttl":2592000,"transientcontent":false}}});});</script> </body> </html>