views:

762

answers:

2

I've done my best to research and try solutions I've found before posting this, hopefully it will help others also.

I'm trying to write urls in Mediawiki to domain.com/PageTitle (I know this is bad practice). I've gotten it 99% working with this:

http://snipt.org/msh (off a tutorial for drupal so might be completely wrong for my purposes)

But what isn't working is when I add "&action=purge" to the end of a page title. It tries to show me a page called "PageTitle&action=purge".

I'm not sure how I got around this in Apache.

Any help is greatly appreciated.

A: 

Some more information, pages with a / in the title don't show the logo because it thinks it's suddenly one directory wrong.

Here's my rules in Apache:

RewriteEngine On

/#anything that contains a dot without a colon should be left alone

RewriteRule ^[^:]*. - [L]

/#anything that contains a slash without a colon should be left alone

RewriteRule ^[^:]*\/ - [L]

/#redirect to main page

RewriteRule ^/*$ /index.php?title=Main_Page [L,QSA]

/#anything else is to be treated as a title

RewriteRule ^(.+)$ /index.php?title=$1 [L,QSA]

I need to convert the first two for nginx, and then we'll see where that get's me. Any help with that?

+1  A: 

NginxMediaWiki:

http {
  include       mime.types;
  default_type  application/octet-stream;

  sendfile        on;
  keepalive_timeout  30;
  gzip  on;
  charset utf-8;

  server {
    listen 80;
    server_name wiki.nginx.org;

    root /var/www/mediawiki;

    access_log /var/log/nginx/wiki.nginx.org-access.log;
    error_log  /var/log/nginx/wiki.nginx.org-error.log info;

    location / {
      index index.php5;
      error_page 404 = @mediawiki;
    }

    location @mediawiki {
      rewrite ^/([^?] *)(?:\?(.*))? /index.php5?title=$1&$2 last;
    }

    location ~ \.php5?$ {
      include /etc/nginx/fastcgi_params;
      fastcgi_pass  127.0.0.1:8888;
      fastcgi_index index.php5;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
  }
}
Valery Victorovsky