Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

[MediaWiki] - Friendly URL's - (IF's are Bad)

$
0
0
Hey All,

I am still rough around the edges with nginx, but I am getting better :-) I am trying to setup MediaWiki with Friendly URL's. I found this link on there site on how to do so with nginx: https://www.mediawiki.org/wiki/Manual:Short_URL/Page_title_-_nginx,_Root_Access,_PHP_as_a_CGI_module ... BUT you will note all of the IF's. Here is the code without needing to go to the link above:

location / {
if (!-e $request_filename) {
rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&$2 last;
}
if ($uri ~* "\.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$") {
expires max;
break;
}
}

&&

location ~ \.php$ {
if (!-e $request_filename) {
return 404;
}
fastcgi_pass Etc. Etc. ...

Is there a better way to do this with try_files or something? If that has been talk about before, please feel free to link!

Thanks,
-Bill

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>