Mobile app version of vmapp.org
Login or Join
Nickens628

: Rewrite in Mediawiki, remove index.php, .htaccess I've just installed Mediawiki on Apache and I want the URL should be: localhost/Main_Page/ localhost/Special:Recent_Changes ... instead of: localhost/index.php/Main_Page/

@Nickens628

Posted in: #301Redirect #Apache #Htaccess #Mediawiki #Redirects

I've just installed Mediawiki on Apache and I want the URL should be:

localhost/Main_Page/
localhost/Special:Recent_Changes
...


instead of:

localhost/index.php/Main_Page/
localhost/index.php/Special:Recent_Changes


I've tried many times and in many ways but it still doesn't work. Any suggest for a "exactly" what to do, step by step. Mediawiki docs didn't talk about .htaccess. It had only Nginx and lighttpd.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Nickens628

3 Comments

Sorted by latest first Latest Oldest Best

 

@Rambettina238

You can have clean URLs with the following step.

Install the wiki into localhost/w and NOT into localhost/wiki then Modify the following in LocalSettings.php after you have set it up:

$wgArticlePath = "/wiki/";


In the ROOT directory place the following .htaccess file:

RewriteEngine on

## uncomment this rule if you want to redirect to localhost/wiki/Main_Page # RewriteRule ^/$ /wiki/Main_Page [R]

## do the rewrite
RewriteRule ^wiki/?(.*)$ /w/index.php?title= [L,QSA]

10% popularity Vote Up Vote Down


 

@Sherry384

Try the following code:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/(.*)$ /mediawiki/index.php?title=&actions= [L]

10% popularity Vote Up Vote Down


 

@Jessie594

This MediaWiki documentation does talk about .htaccess.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme