Wiki Rewrite help please

casiphin

New Member
Messages
2
Reaction score
0
Points
0
Hi.

I was wondering if i could get some help with rewrite and mediawiki

I installed MediaWiki with the Softaculous script installer and using tutorials I found online enabled rewite, however, there seems to be an issue some where that i can't seem to find.

here is my .htaccess file
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/(skins|stylesheets|images|config)/
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php
RewriteRule ^(.*)$ /index.php [L,QSA]



and here is the relevant lines from localsettings.php
Code:
$wgScriptPath       = "";
$wgScript           = "$wgScriptPath/index.php";
$wgRedirectScript   = "$wgScriptPath/redirect.php";
$wgArticlePath      = "$wgScriptPath/$1";

the problem i'm getting is that while it does redirect it doesn't seem to want to apply an CSS or JS to the pages. i'm not sure where i went wrong but i am hoping someone here may be able to help.

my site is casiphin.x10.mx



Any help i can get would be very appreciated
Thank you
Casiphin

@SierraAR Okay, Sorry for putting it the wrong spot
 
Last edited:

SierraAR

Community Advocate
Community Support
Messages
827
Reaction score
17
Points
18
Moved to the 'Scripts, 3rd Party Apps, and Programming' section
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
Do the following instead:

1. Move your wiki's files out of the root directory. It is an unsupported MediaWiki configuration (and in general a crappy idea) to have your files reside in the same location as where you are trying to rewrite to. A suggested configuration is to put MediaWiki in a /w subdirectory of your web root (so index.php would lie at mysite.x10.mx/w/index.php).
2. Do not rewrite to your web root. Again, it is an unsupported MediaWiki configuration to do so as it can cause issues with accessing other necessary files on your site, such as robots.txt and favicon.ico, or even the wiki itself if configured wrong. A suggested configuration is to use /wiki as the "virtual directory" to access the wiki via pretty urls (so you would access your wiki via mysite.x10.mx/wiki/Pagename)
3. If you followed the suggestions above, use the following .htaccess file (taken from mediawiki.org). THIS WILL NOT WORK if you are rewriting into the web root or have the wiki's files in the web root.
Code:
RewriteEngine On

# Change "wiki/" below to match your desired virtual path.
# Change "w/" to match your actual installation directory.
RewriteRule ^wiki/(.*)$ /w/index.php?title=$1 [PT,L,QSA]
RewriteRule ^wiki/*$ /w/index.php [L,QSA]
4. Modify your LocalSettings.php so it contains the following
PHP:
# Short URL stuff
# Change "/wiki" below to match your desired virtual path, and "/w" to your wiki's files
$wgScriptPath = "/w";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
5. Completely remove what you had above (you do NOT need to set $wgScript or $wgRedirectScript, leave them out of LocalSettings.php completely so they take on their default values)

In the future, if you have need of assistance with MediaWiki, I am also active on the mwusers forum, and you can also find assistance on MediaWiki's IRC channel on freenode, both of which are more likely to get a solid answer than asking here, unless the question is x10-specific ;)
 
Top