I am using mediawiki on my localhost server. my url for now is 127.0.0.1:8080/wiki/index.php/Main_Page
But i want to convert above mentioned url to wiki.127.0.0.1:8080 or something like wiki.nikunj.com if my wiki is url is www.nikunj.com/wiki
I read this article http://www.mediawiki.org/wiki/Manual:Short_URL but not able to achieve it.
They have given how to convert www.example.com to wiki.example.com but using Lighthttpd.
here is the code:
$HTTP["host"] == "wiki.example.com" {
server.document-root = "/path/to/webroot"
url.rewrite-once = (
"(^/[^:]*[\./].*)" => "$1",
"^/([^?]*)(?:\?(.*))?" => "/w/index.php?title=$1&$2",
)
}
Also i have a website like www.nikunj.com. There i installed wiki to www.nikunj.com/wiki, now i want to port it to wiki.nikunj.com
I tried this but it doesn't worked.
With mod_rewrite:
<VirtualHost *:80>
ServerName wiki.nikunj.com
RewriteEngine on
RewriteRule ^/(.*) http://www.nikunj.com/wiki/$1 [R,L]
</VirtualHost>
With mod_alias:
<VirtualHost *:80>
ServerName wiki.nikunj.com
RedirectMatch ^/(.*) http://www.nikunj.com/wiki/$1
</VirtualHost>
But is is not working please, help me out.