rewrite rules cms phpwcms not working

dansch8888 nginx-forum at nginx.us
Tue Feb 17 23:26:59 UTC 2015


Hi Francis,

thank you for this really good explanation.

I tried your examples and they work very well.
In the next days I will test it more extensive.

> >
(track|include|img|template|picture|filearchive|content|robots\.txt|favicon\.ico)($|/)
> > - [L]
> I think that say "anything that matches that pattern should be served
> as a plain file, and not given to the php interpreter". But there are
> also .htaccess files in some of those directories.

Yes, that's true, but isn't it also that at the apache server this folders
and files are just excluded for rewrite?
In my config I set folders with .htaccess only at the moment. 
location ^~ /config/			{ deny all; }
location ^~ /filearchive/		{ deny all; }
location ^~ /track/				{ deny all; }
location ^~ /upload/			{ deny all; }

> if ($request_uri ~ /(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\d+)\.html) {
> set $bit_of_qs "id=$1,$2,$3,$4,$5,$6";
> }

This is comming from some old versions of the CMS I believe, were not always
aliases were set up.
At the moment, when you create a article, the CMS sets an dummy alias by
default.
In the "old" time, there were urls like this index.php?id=0.0.0.0.0.0
Now there are normaly such urls index.php?dummyalias only.

> location / {
> try_files $uri $uri/ @index.php;
> }

Is there a need for the $uri/?
I had read this is for subfolder only. This CMS need the rewrite just for
the root folder and index.php.

Thank you so fare for this quick help.

Daniel

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,256693,256740#msg-256740



More information about the nginx mailing list