Topic on Project:Support desk

URLs to Uploaded Files are Being Unintentionally Redirected

2
Jordan Barden (talkcontribs)

Hello all:

I have a MediaWiki installation--viewable at "http://www.alecexposed.org/"--that is running MediaWiki 1.27.1, PHP 5.6.27 and MySQL 5.1.56, and have come across a couple of issues that have me stumped.

1. The URLs to some of the uploaded files are redirecting improperly when accessed without the "www." prefix. For example, when I click on http://alecexposed.org/w/images/c/c8/1R10-Right_to_Work_Act_Exposed.pdf, the "www." prefix is appended, as intended, but the "w/images/" portion is being stripped from the URL.

I have no clue why this is happening, given the current .htaccess file, the contents of which follow:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^alecexposed\.org$ [NC]

RewriteRule ^(.*)$ http://www.alecexposed.org/$1 [L,R=301]

RewriteRule ^/?wiki/(.*)$ /w/index.php?title=$1 [PT,L,QSA]

RewriteRule ^/?wiki/*$ /w/index.php [L,QSA]

RewriteRule ^/*$ /w/index.php [L,QSA]

2. Additionally, it appears that some of the uploaded files are not searchable within the list of uploaded files (http://www.alecexposed.org/wiki/Special:ListFiles), despite the fact that they do appear in the list. I ran rebuildtextindex.php to rebuild the search index but it did not fix the problem.

I'm not sure if these two issues are related or it's just a coincidence that they are occurring simultaneously.

Any assistance you can give me is greatly appreciated.

Thank you!

Ciencia Al Poder (talkcontribs)

there must be another .htaccess somewhere. Is this one the .htaccess inside the /images folder? in this case, it may be this:

RewriteRule ^(.*)$ http://www.alecexposed.org/$1 [L,R=301]

Although it's a bit strange because this one will append the whole URL at the end of the server name. The [L] will skip processing the rest of the rewrite rules.

Reply to "URLs to Uploaded Files are Being Unintentionally Redirected"