Topic on Project:Support desk

MediaWiki redirecting me to address with additional resource IDs

4
Ivan0890 (talkcontribs)

I can access my wiki via 192.168.1.100/mediawiki, where 192.168.1.100 is an example of my private IP. However, whenever I log in from the main page from my wiki it directs me to "192.168.1.100/mediawiki/index.php/192.168.1.100/mediawik/index.php/Main_Page"


Similarly, when I access my wiki using localhost as server name and then log in, I get redirected to "localhost/mediawiki/index.php/192.168.1.100/mediawiki/index.php/Main_Page"


The workaround now is to manually delete the extraneous resource IDs (/192.168.1.100/mediawiki/index.php/) after logging in, which will take me to the Main Page.


Why am I getting the extraneous /192.168.1.100/mediawiki/index.php/ resource IDs upon redirect, and how to I resolve this?


edit: Seems like this is happening not only when I log in but also when I make edits to pages
edit2: Some more information: When I navigate using internal links, this issue does not come up. It seems like it's only happening when MediaWiki is trying to redirect to another page

Bawolff (talkcontribs)

what rewrite rules do you have set?

What is $wgServer, $wgArticlePath, $wgScriptPath set to

Ivan0890 (talkcontribs)

$wgServer = "192.168.1.100";

$wgScriptPath = "/mediawiki";

$wgArticlePath is not set


edit: while attempting to fix this issue, I've tried setting $wgServer = "WebRequest::detectServer()"; When I did this, MediaWiki no longer redirected me when I clicked "Log in" or "Save Changes"

Ivan0890 (talkcontribs)

I changed the $wgServer = "http://192.168.1.100"; and the issue was resolved.


I believe this was because without the protocol, MediaWiki took that variable to be a relative path instead of the entire server name. Can anyone confirm if this is true?