Forum

UrlToolKit

Rahul
16 August 2012, 12:01

Hello,

Please explain what does "Continue|Return" mean in Rewrite of UrlToolKit which is mentioned in manual page .
Hugo Leisink
16 August 2012, 14:32
Continue: Hiawatha will continue processing the current UrlToolkit rule after the rewrite.
Return: Hiawatha will return from the current UrlToolkit rule after the rewrite. If the current rule has not been called the Call command, the UrlToolkit process ends. Otherwise, it continues after the Call command in the calling rule.
Rahul
23 August 2012, 07:50
I have three files:
abcd.txt, having text "I am in abcd file"
xyz.txt, having text "I am in xyz file"
aaa.txt, having text "I am in aaa file"

hiawatha.conf file have UrlToolKit settings as below:
UrlToolKit {
ToolkitId = rewrite
Match ^/abcd.txt Rewrite /xyz.txt Continue
Match ^/abcd.txt Rewrite /aaa.txt
}

When i give URL "http://ip-address/abcd.txt", i get output "I am in xyz file" but not get "I am in aaa file". Is there something wrong in UrlToolKit settings in hiawatha .conf file.
Hugo Leisink
23 August 2012, 12:20
That's logic, because when requesting /abcd.txt, the first rewrite rule changes the url to /xyz.txt. Because /xyz.txt doesn't match the /abcd.txt from the second rewrite rule, the second rewrite rule is not performed.
Rahul
24 August 2012, 08:54
Got it...so is it possible by somehow to match again abcd.txt in second Rewrite.
Hugo Leisink
24 August 2012, 09:04
No. Once it is rewritten, the previous URL is gone. What is it you try to achieve?
Rahul
5 September 2012, 07:56
Ok...One more thing...if i want to do first Rewrite operation on every .txt file like for example if my original URL is abcd.txt or 1234.txt or myurl.txt or any other .txt then it should be Rewrite by xyz.txt, so to achieve this what should be the syntax of first Rewrite operation line in UrlToolKit.
Hugo Leisink
5 September 2012, 08:47
Match ^/.*\.txt Rewrite /xyz.txt
Rahul
5 September 2012, 13:24
Thanks...
This topic has been closed.