Forum

Match all url

Charles Li
16 March 2017, 04:28
Hi:

I want to match all the request by "Match .* Rewrite /test.php", But I entered in the browser "http://127.0.0.1", It gives me 404.
I entered "http://127.0.0.1/zz", it is work.
How can I Match "http://127.0.0.1"?
Hugo Leisink
16 March 2017, 08:00
The .* does also match for http://127.0.0.1/ The 404 must be caused by something else. Cache?
Charles Li
16 March 2017, 09:33
thank you for your reply.

I found the problem with my configuration file,
# Hiawatha main configuration file

ConnectionsTotal = 150
ConnectionsPerIP = 10

Binding {
Port = 80
# Interface = 127.0.0.1
# MaxKeepAlive = 30
# TimeForRequest = 3,20
}

UrlToolkit {
ToolkitID = testID
RequestURI exists Return
Match .* Rewrite /cc.html
}

Hostname = 127.0.0.1
WebsiteRoot = /www
StartFile = index.html
UseToolkit = testID


There is no index.html in my /www directory.
When I remove "RequestURI exists Return" ,"http://127.0.0.1" can work.
Why it give me 404 with "RequestURI exists Return"?
Charles Li
16 March 2017, 10:01
RequestURI exists|isfile|isdir|notfound <action>
Perform an action based on the presence of the requested file, where <action> can be one of the following:
Call, Return, Exit or Skip.
Example: RequestURI isfile Return

When I looked at the introduction carefully, I knew the reason.
Change "exists" to "isfile" can work, I think "exists" can match Directory.

Thank you, Hugo.
Hugo Leisink
17 March 2017, 09:26
Yes, 'exists' matches both file and directory. And since the website root directory exists, it returns from the rule.
This topic has been closed.