Forum

.htaccess to URL Toolkit ending trailing slash question

Ciril
19 April 2012, 04:59
Hi Hugo,

Hiawatha - what an amazing web server, thank you for all hard work.

I have newbie question regarding URL REWRITE - ending trailing slash question.
Just ported/rewrite pretty long .htaccess into URL TOOLKIT for Hiawata, it works great but...

I have 2 rules for FOLDER redirection to actual file:
Match /vendors Rewrite /ext__vendors.php
Match /vendors/ Rewrite /ext__vendors.php


How to make this rule so typing in browser:
http://site/vendors
OR
http://site.com/vendors/

Either of them will access: ext_vendors.php

Is there any way to make it just with 1 rule?

Thanks,
Best
Ciril

Hiawatha version: 8.1
Operating System: Win 7 x64
Hugo Leisink
19 April 2012, 07:26
The UrlToolkit rule you are looking for is:
UrlToolkit {
ToolkitID = x
Match ^/vendors(/)?$ Rewrite /ext_vendors.php
}

If you want to understand how it works, I advice you to google for 'regular expressions'.
Ciril
19 April 2012, 11:28
Thank you Hugo. Brilliant.
I will be doing some heavy testing soon.
Planning to create few Win32 tools and share with Hiawatha users.

Take care,
Ciril
Hugo Leisink
19 April 2012, 12:14
Please note that Hiawatha was built for Unix, not Windows. The reason the Windows version exists is because it was so easy to build via Cygwin. The Windows version is significant slower than the Unix version. And not all features are available in the Windows version, such as the CGI-wrapper.
Ciril
19 April 2012, 12:58
Yes I know
I'm using lots of custom written tools mainly CMD tools, small EXE's, so that's reason I have to stay Windows all the way.
Or installing VMWare Workstation on CentOS - running optimized Win 2003 for CMD tasks, and Hiawatha under Cent.

Hiawatha - small memory footprint/features compared to monster Apache and it's horrible memory leaks over time.
I will run some heavy benchmarks in few days.


Ciril
19 April 2012, 13:01
Hugo, do you think Hiawatha could be compiled with - "Gow - The lightweight alternative to Cygwin" and have better performance then Cygwin compiler.

https://github.com/bmatzelle/gow/wiki
Hugo Leisink
19 April 2012, 13:05
Please, share the results of the benchmarks with me. I will take a look at Gow.
This topic has been closed.