Manual talk:Short URL/wiki.example.com/Page title--Subdomain with no Subdirectory in Article URL

I wanted direct requests to the Main_Page when the URL was "" or "/". My directory structure is a bit redundant, but it's:

/var/www /var/www/mediawiki /var/www/mediawiki/wiki

I used this vhost to do the desired redirects. Also note that I changed the main redirect specified on this page to ignore the leading slash as it wasn't passing the correct content to index.php:

 ServerName wiki.YOURDOMAIN..com DocumentRoot "/var/www/mediawiki"

RewriteEngine On

#allow fetching of css, js and the like RewriteRule ^/(W|w)iki/skins/([a-z]+)/(.+)$	/wiki/skins/$2/$3 [L] #allow fetching of fave icon RewriteRule ^/favicon.ico$	/wiki/favicon.ico [L] # get home page requests to Main_Page RewriteRule ^(\/*)$	/wiki/index.php?title=Main_Page [L] # all other requests go to specific page RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(\/*)(.*)$ /wiki/index.php?title=$2 [L,QSA] 


 * The downside to using your "get home page requests to Main_Page" is that (at least for me), it doesn't rewrite to wiki.example.com/Main_Page, it actually shows Main_Page as wiki.example.com/, which means there's two URLs to Main_Page (very bad for search!). I'd tried using RedirectPermanent / /Main_Page but that caused a loop of adding Main_Page to the url forever. --IBulk 19:01, 18 November 2008 (UTC)