I am having some problems with regular-expression with rewrite in NGiNX.
Here is my config:
location /wiki/ {
rewrite ^/([^?]*)/([^?]*)(?:\?(.*))? /$1/index.php?title=$2&$3 last;
}
Here is the URL of the main page: //example.com/wiki/en/Main_Page
I have two problems.
First when I go to this URL: //example.com/wiki/en
It says the page does not exists. Is there a way to force a / to be added a the end of the "en" at the end of the URL? Because if you go to //example.com/wiki/en/ with the / at the end
Second problem:
The images are not loading.
Here is the URL of the position of MediaWiki images: //example.com/wiki/en/skins/common/images/image name
So is there a way for my regular expression to ignore the URL if it is trying to get an image?