Forum

Need help translating these .htaccess rules to a tookit

Gilad
16 September 2015, 15:57
HI,
I've tried several options but none seem to be right.
Can someone (Hugo?) please help me translate these rules into a tookit?

htaccess rules are:
# Allow asset folders through
RewriteCond %{REQUEST_URI} "/application/views/pages/"
RewriteRule (.*) $1 [L]

# Protect application and system files from being viewed
RewriteCond %{REQUEST_URI} "/application/views/"
RewriteRule (.*) $1 [F,L]

RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ %{ENV:BASE}/index.php/$1 [L]
Hugo Leisink
16 September 2015, 21:58
VirtualHost {
...
EnablePathInfo = yes
UseToolkit = my_rule
}

UrlToolkit {
ToolkitID = my_rule
Match ^/application/views/ Forbidden
# I have no idea what these two rules are supposed to do.
# RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
# RewriteRule ^(.*) - [E=BASE:%1]
RequestURI exists Return
Match (.*) Rewrite /index.php$1
}
Gilad
17 September 2015, 06:06
Thanks Hugo!
That works :-)
The only thing that still causes a syntax error is the line:
Match ^/application/views/ Forbidden

Maybe it should be:
Match ^/application/views/ Deny ?
Hugo Leisink
17 September 2015, 06:33
Oh crap. Forbidden should be DenyAccess.
Gilad
17 September 2015, 08:22
Thanks!
This topic has been closed.