Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules

Search

Donate to XOOPS!

Please select an amount to donate


Do you want your username revealed with your donation?
Yes - List me as a Generous Donor
No - List my donation as from an Anonymous Donor


Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

admin Arabic banner block Christmas comments cumulus DayDawn dhsoft e-Commerce E-Learning Git Google GUI hacks instant-zero jQuery module mygalleries news Nordic Olédrion oxygen PageRank PHP rmcommon security SEO simple-XOOPS Smarty sport tag Theme tutorial wiki WOX xoops XoopsEngine ZendFramework

New Users

Registering user

# 133948

guilhermeans

Welcome to XOOPS!
[Main Page]

Mw:Manual:Short URL

From XOOPS Web Application System

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy
Categories: Manual | Configure | Wiki page URLs

According to World Wide Web inventor Tim Berners-Lee, good webpage addresses should never change.[1] Short webpage addresses which hide complex programming code from the webpage address bar is good for webpage visitors.

MediaWiki's default webpage addresses look like these examples:

http://example.com/wiki/index.php/Page_title (MediaWiki version 1.11.0) or
http://example.com/wiki/index.php?title=Page_title

Using the methods below, short webpage addresses can be changed to addresses such as these:

http://example.com/Page_title
http://example.com/wiki/Page_title
http://wiki.example.com/Page_title

How to shorten a webpage addresses gets complicated fast. So the "how to" miniguides will be on separate pages listed below.


Contents

Root access or no root access?

Shared Hosting: If you are using a shared host it is unlikely you will have root access to the server. You probably will not be able to use any of the root access techniques below. First try to open a ticket with your hosting provider. Ask the provider how to get rid of the "index.php?title=" for all pages and your hosting provider may well solve your problem for you.

If you do not have root access, the .htaccess, located in the public_html folder can be rewritten without root access. Depending on your host, you may be able to use an alias or a rewrite rule in an .htaccess file.

You only need to edit either .htaccess or httpd.conf, not both. If you have the choice, edit httpd.conf. Editing httpd.conf, which requires root access, is the preferred method because your wiki performs better.<ref name="technicalexplanation">Should you edit httpd or htaccess? Besides not requiring access to edit httpd.conf, the advantage of editing .htaccess is that all directories which are not mentioned in the RewriteRule for directories are not reachable from the outside anymore. However there is a performance penalty, as httpd then has to search up the directory tree and process all .htaccess files which may apply.</ref> Most shared hosting systems do not allow changes to httpd.conf.

  • See the Apache article, When (not) to use .htaccess files.<ref name="apache">Until further notice, only Apache supports (out-of-box) rewrites such as Wikipedia's transforming ugly long URLs into simple short ones such as:
  • http://localhost/index.php?title=Main_Page

transformed into:

  • http://localhost/Main_Page.</ref>

Short URL "how to" miniguides

Anyone is welcome to create a "how to" solution page and list them below. Please use a sensible name for the page, one that fits in with the below names. When each unique solution has its own page, readers can skip complexity they do not want.

Keep it simple, readable, short, with a separate page per separate solution.

In an attempt to find out which Short URL methods really work, after trying these methods please add either:

  1. a Image:Smiley.svg [[Image:Smiley.svg|20px]] if the method worked or
  2. a Image:Face-sad.svg [[Image:Face-sad.svg|20px]] if the method did not work.

Example.com/Page_title

How to create: example.com/Page_title webpage addresses

Example.com/wiki/Page_title

How to create: example.com/wiki/Page_title webpage addresses

Root access
These methods require that you have access to the server configuration. If you are on a shared host, you most likely don't; see the "no root access" examples instead.

Wiki.example.com/Page_title

How to create: wiki.example.com/Page_title webpage addresses

Ampersand (&) problem

Explanation: This problem shows up when you have page titles with symbols in (such as &, ?, #, + and /) that, despite being correctly encoded in the link are not being passed correctly from mod_rewrite to the script. This manifests in 404 page not found errors, because the title gets cut off at the special character. e.g. Clicking on a link "John & Maria's page" gets a 404, because MediaWiki is looking for a page names "John ".<ref name="technicalexplantion2">Reason for the Ampersand problem: The reason for the Ampersand problem is that using the long form means that articles can't have ampersands in their name because they would be treated as query string separators and would never reach the PHP runtime environment. The cause of the is Ampersands problem is an old and problemic mod_rewrite bug. There are discussions of other possible solutions at lists.wikimedia.org and fgiasson.com.</ref>

Solutions:

Tricks

Troubleshooting

Technical notes

<references/>

See also

External links

Retrieved from "http://xoops.org/modules/mediawiki/index.php/Mw:Manual:Short_URL"

This page has been accessed 2,166 times. This page was last modified 08:02, 20 November 2007. Content is available under XOOPS Web Application System.