Changing your URL in MediaWiki Updated on August 16, 2021 by InMotion Hosting Contributor 1 Minutes, 4 Seconds to Read In this tutorial we will show you how to change your URL in Mediawiki. This is useful when testing your site on a Shared SSL, or when you want to modify your domain name. It will be accomplished by editing the LocalSettings.php file. For this article I am changing the URL from: https://example.com/mediawiki to: https://secure49.inmotionhosting.com/~userna99/mediawiki You must already have MediaWiki installed before attempting this guide. How to Change your URL: Using the editor of your choice, navigate to the LocalSettings.php file in the folder you installed MediaWiki. Locate the line of code that begins with $wgServer. By default, it will look similar to this: $wgServer = "https://example.com"; Change the domain to your new URL, and save your settings. In my test I am using a shared SSL, it will look similar to this after: $wgServer = "https://secure49.inmotionhosting.com"; Next, in your LocalSettings.php locate the line beginning with $wgScriptPath, it may look similar to this by default: $wgScriptPath = "/mediawiki"; Enter the new folder location if it is changing. For example: $wgScriptPath = "/~userna99/mediawiki"; Save your changes, and test the website. You may have to clear your browser cache before seeing the changes. Congratulations, now you know how to change your Mediawiki URL! Share this Article IC InMotion Hosting Contributor Content Writer InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals! More Articles by InMotion Hosting Related Articles Creating a new user in SMF 2.0 Changing a user’s password in SMF 2.0 What Is a Wiki? Editing the Footer in MediaWiki How to insert images into MediaWiki Managing passwords and usernames in MediaWiki How to make basic changes to mediawiki skins How to manually install SMF How to install SMF 2.0 with Softaculous How to log into your SMF admin dashboard
Sadly this doesn’t work for me. I followed the steps, and now my wiki looks like it’s just made of text and klickable links. No formatting at all. And the URL stayed the same. It’s still the IP instead of the chosen domain.
Verify that the folder locations you are using are accurate. If it is still not working you may have to undo your changes to restore your site, then reach out to a Developer to help make the change.
Thanks a lot for posting this helpful tidbit. It saved me a lot of time trying to figure out what to do when I change DNS names with MediaWiki!