Forum

AnchorCMS

myawatha
8 September 2015, 02:18
Currently attempting to come up with the correct rewrites for the anchorCMS (unsuccessfully). I've tried using their documentation seen: https://github.com/anchorcms/anchor-cms/wiki/mod_rewrite
but have been unable to get it to work. Currently the homepage works (after default installation), but all other pages that have /index.php/_/ error out to 404 not found.
I have my website root set to the installation directory with my startfile being index.php. Which has allowed me to access my startpage. When it comes to the admin panel or anything else, again, /index.php/_/ errors out to 404 not found.
Hugo Leisink
8 September 2015, 12:11
Try adding "EnablePathInfo = yes" to your virtual host configuration.
myawatha
8 September 2015, 21:08
Added; nothing changed.
*** I also have all of the PreventXXX's turned off as well as SecureURL = false.
Hugo Leisink
9 September 2015, 09:06
Can you show me the configuration?
myawatha
9 September 2015, 17:01
ServerId = www-data
ConnectionsTotal = 1000
ConnectionsPerIP = 25
SystemLogfile = /var/log/hiawatha/system.log
GarbageLogfile = /var/log/hiawatha/garbage.log

Binding {
Port = 80
# Interface = 127.0.0.1
# MaxKeepAlive = 30
# TimeForRequest = 3,20
}
#
Binding {
Port = 443
MaxRequestSize = 128
TimeForRequest = 3,20
SSLcertFile = /etc/hiawatha/ssl/serverkey.pem
}

#BanOnGarbage = 300
#BanOnMaxPerIP = 30
#BanOnMaxReqSize = 300
#BanOnTimeout = 300
BanOnSQLi = 3600
#BanOnMaxReqSize = 3600
BanOnMaxPerIP = 300
#BanOnGarbage = 3600
#BanOnFlooding = 15/1:300
BanOnWrongPassword = 30:180
#BanOnDeniedBody = 240
#KickOnBan = yes
#RebanDuringBan = yes
#PreventCSRF = yes
#PreventSQLi = yes
#PreventXSS = yes
ShowIndex = no
#RequireSSL = yes
SecureURL = false
EnablePathInfo = yes
#BanlistMask = deny LOCALHOST, deny LAN, deny WLAN

ExecuteCGI = yes
CGIextension = cgi
CGIhandler = /usr/bin/php5-cgi:php,php5
#CGIhandler = /usr/bin/perl:pl
#CGIhandler = /usr/bin/python:py
#CGIhandler = /usr/bin/ruby:rb
#CGIhandler = /usr/bin/ssi-cgi:shtml
TimeForCGI = 15

ServerString = Apache
UseToolkit = dfind
UrlToolkit {
ToolkitID = dfind
RequestURI exists Return
Match ^(.*)$ Rewrite index.php/$1
}

Hostname = 127.0.0.1
WebsiteRoot = /var/www/hiawatha/anchor
StartFile = index.php
AccessLogfile = /var/log/hiawatha/access.log
ErrorLogfile = /var/log/hiawatha/error.log
#ErrorHandler = 404:/error.cgi
SecureURL = false
myawatha
9 September 2015, 17:02
Thank you for the assistance by the way @Hugo. Really appreciate it.
David Oliver
9 September 2015, 23:46
What does SecureURL do? I can't find it in the manual.

Try:

RequestURI exists Return
Match ^/$ Rewrite index.php
Match ^/(.*)$ Rewrite index.php/$1


I'm not sure if that's the cleanest way, but maybe it will work.
myawatha
10 September 2015, 00:08
Gave it a whirl. No dice. Same results. 404 on every page /index.php/_/
& with regard to SecureURL, from a previous posting by Hugo: "weird URLs (lots of %xx in the URL). Presence of such characters can indicated an attack on your website, therefor Hiawatha refuses requests which has those characters in the URL. You can use the SecureURL setting to disable this security check."
Hugo Leisink
10 September 2015, 01:09
Change
Match ^(.*)$ Rewrite index.php/$1
to
Match ^/(.*)$ Rewrite /index.php/$1
David Oliver
10 September 2015, 10:14
D'oh. I forgot the leading slash on the target. It's been too long since I wrote rewrite rules.
This topic has been closed.