htaccess subdomain to "folder" mediawiki
I'm running a mediawiki installation with a "nice" URL htaccess to show https://example.com/Wiki/Page
I'd like to enable localization and translation on subdomains.
I think that should be achievable with
.htaccess, but I'm not a mediawiki expert. Is there anyone out there that can help with enabling mediawiki translations on a subdomain like the above? I think it's just an
.htaccess question, but not sure what it might break with mediawiki too :)
See also questions close to this topic
RewriteRule for special characters
I have checked through the threads all day and cant make this work.
When i input "ö" in my search box the the url result become "%25C3%25B6"
So I search for "Örebro" and the search gives "%25C3%25B6rebro"
I try fix this with htaccess.
This is what I tried and many other options but nothing works.
RewriteRule ^%25C3%25B6(.*) ö$1 [L,R=301]
This is how my url looks like:
I need it like this
I can make it work when is a simple word but it do not work when it contain special characters.
htaccess rewrite rule redirects with wrong Server Name
We are using lines like
RewriteRule ^folder/(.+)?$ folder/$1 [L]
in our htaccess file. Our Server_Name is naturally "bad-server-name" but we use a CDN to block out traffic to "bad-server-name" and use "good-server-name" instead. When I go to "https://good-server-name.com/bot" it should redirect to "https://good-server-name.com/bot/" but it 301 redirects to "https://bad-server-name.com/bot/". Using our CDN we have a server header that stores "good-server-name". Is there a way to make the htaccess file redirect to "https://good-server-name.com/bot/"?
.htaccess rewrite when form submission
Let's say I have a website where the main page (index.php) of this website has a simple form. It's a text box where you enter a country, and submit it. It submits to results.php by GET. This page, given that the country exists, outputs a list of elements associated with that country.
So you go to example.com, you enter "Argentina" into the form and submit it. The browser makes a request to
example.com/result.php?country=Argentina, and there you see the results.
But I would like to do this by routing/rewriting. So instead of the page listing the elements for Argentina being located at the URL
example.com/result.php?country=Argentina(Long And Ugly), I want it to be located at
example.com/Argentina(Short And Sweet).
One way of half way achieving this is through rewriting in the .htaccess like this:
RewriteRule ^([^/]+)/?$ result.php?country=$1 [NC]
Now I can go to the SAS URL and see the same page as if I went to the LAU URL. Great for linking and SEO. But as index.php submits a form to result.php, if I actually do the search for Argentina from the main page, I will still be taken to the LAU URL, and not the SAS URL.
I know one way to get around this is to instead make a rewrite rule that takes the LAU URL and redirects to the corresponding SAS URL, and also have a rule sending all SAS URLs to result.php, and let result.php handle the parameters by exploding
$_SERVER['SCRIPT_NAME']. But somehow, this doesn't seem very clean. Is there a better way, that ensures I will also see the SAS URL when submitting the form?
Collapsing section heading in Mediawiki MobileFrontend
In MobileFrontend for Mediawiki, sections can be collapsed using the parameter $collapseSectionsByDefault = true. But this only applies to H2 sections (= first-level titles) but not to inferior-level sections (H3, H4, H5 and H6 titles).
However, this function seems to exist, I've found up these lines in the line 240 of extensions/MobileFrontend/ressources/mobile.toggle/toggle.js (see here):
// Also allow .section-heading if some extensions like Wikibase // want to toggle other headlines than direct descendants of $container. $firstHeading = $container.find( '> h1,> h2,> h3,> h4,> h5,> h6,.section-heading' ).eq( 0 ); tagName = $firstHeading.prop( 'tagName' ) || 'H1';
How to toggle other headlines than H2 in MobileFrontend 1.30 or 1.31?
Thanks in advance!
Concurrent Python Wikipedia Package Requests
I am making a python application which uses the python Wikipedia package to retrieve the body text of 3 different Wikipedia pages. However, I am noticing very slow performance when retrieving the articles one at a time. Is there a method that I can use to retrieve the body text of 3 Wikipedia pages in parallel?
MediaWiki CSS not loading, MIME type error
I've tried using the console to debug in Chrome and get the following error message:
Refused to apply style from 'http://jollof.mariadavydenko.com/wiki/load.php?debug=false&lang=en&modules=mediawiki.feedlink%2Chelplink%2CsectionAnchor%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.skinning.content.externallinks%7Cmediawiki.skinning.interface%7Cmediawiki.special.changeslist%7Cmediawiki.special.changeslist.enhanced%2Clegend%7Cskins.monobook.styles&only=styles&skin=monobook' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
I am running PHP version 5.6 and MySQL version 5.7. I've tried the
load.php.htaccess fix recommended for these symptoms but it doesn't work -- load.php loads just fine. Any help would be greatly appreciated.