Forum

URL Toolkit GetSimple CMS

Martijn
21 June 2013, 21:23
I'm using GetSimple CMS but I'm having trouble converting the htacces to url toolkit.

This is the rewrite line from the htaccess file:

RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]

I've converted it to this:
UrlToolkit {
ToolkitID = getsimple
Match .xml DenyAccess
RequestURI exists Return
Match /?([A-Za-z0-9_-]+)/?$ Rewrite /index.php?id=$1
}

But when testing it with wigwam it does not work completely.

wigwam -t getsimple

Using /etc/hiawatha
Reading hiawatha.conf

===[ URL toolkit tester
Use empty input to leave the program.

url: /test/
new: /index.php?id=test

url: /test/test2
new: /test/index.php?id=test2

url:


If the url has 1 part (/test) everything works. If the url has 2 or more parts (/test/test2) it goes wrong. See how /test goes before index.php.
It should be /index.php?id=test2

But I can't figure out what I'm doing wrong.

Hiawatha version: 9.1
Operating System: Debian 7.1 32 Bit
Hugo Leisink
21 June 2013, 21:55
Try these:
Match /?([A-Za-z0-9_-]+)/?\?(.*)$ Rewrite /index.php?id=$1&$2
Match /?([A-Za-z0-9_-]+)/?$ Rewrite /index.php?id=$1
Martijn
21 June 2013, 22:38
Same result:

url: /test/test2
new: /test/index.php?id=test2

Hugo Leisink
22 June 2013, 10:07
Ah, oke. I only read your post half. Though it was again the GET parameter issue.

Well, the rewriting does as it is configured. So it's working well. If it should be something different, please consult the author of the framework / rewrite rule. I have no idea how it should work. What is the expected output for /test/test2?
Martijn
22 June 2013, 13:14
The expected output is that the last part of the url is the page name/id for the CMS.

An url like http://mysite.com/news should be rewritten to http://mysite.com/index.php?id=news.
An url like http://mysite.com/news/yesterday should be rewritten to http://mysite.com/index.php?id=yesterday.

.htaccess example for GetSimple CMS:
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]

Lighttpd example for GetSimple CMS:
url.rewrite = (
"/(admin)/?(.*)" => "$0",
"/([A-Za-z0-9_-]+)/?$" => "/?id=$1",
)
Martijn
22 June 2013, 13:36
Anyway. I'll do some testing and contact the author of the CMS.
Martijn
24 June 2013, 15:35
Found it.

Did some searching on the GetSimple CMS forum. There was a topic on running the cms on nginx.
The regex pattern that was suggested also works for Hiawatha.

This line works:

Match ^(/[A-Za-z0-9\-]+)?/([A-Za-z0-9\-]+)/?$ Rewrite /index.php?id=$2;
This topic has been closed.