Forum

Ngins rule conversion

Fred
18 May 2015, 23:32
Hi Hugo,

Could you please tell me what would the Hiawatha equivalent be for the following rules?
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

rewrite /files/$ /index.php last;

if (!-e $request_filename) {
rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
}


Also, could you please tell me how I can learn to write such rules? I looked at the man page but was unable to see it

Thank you

Hiawatha version:
Operating System:
Hugo Leisink
19 May 2015, 09:11
I'm not sure what those nginx rules do, but here's my guess:
Match ^/files/$ Rewrite /index.php
RequestURI exists Return
Match ^/[_0-9a-zA-Z-]+(/wp-.*) Rewrite /$1
Match ^/[_0-9a-zA-Z-]+(/.*\.php)$ Rewrite /$1

The first wp-admin line can be ignored.

You can learn to write these rules by learning 'regular expressions'. Google for them to see what they are and can do. Also take a look at file config/toolkit.conf inside the Hiawatha source package. This gives you an overview of what the UrlToolkit can do. For the rest, see the manual page.
This topic has been closed.