Forum

Rewrite rules for Selfoss rss aggregator

Roman
13 April 2014, 07:33
Hello!
I need help in transforming rewrite rules for Selfoss rss aggregator.
.htaccess in selfoss main directory contains following rules:

RewriteEngine On

# rule for favicons
RewriteRule !data/favicons/(.*)$ - [C]
RewriteRule favicons/(.*)$ data/favicons/$1 [L]

# rule for thumbnails
RewriteRule !data/thumbnails/(.*)$ - [C]
RewriteRule thumbnails/(.*)$ data/thumbnails/$1 [L]

# rule for front controller
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule !.(js|ico|gif|jpg|png|css|asc|txt|eot|woff|ttf|ttf|svg)$ index.php?%1

# rule for files
RewriteRule !favicons/ - [C]
RewriteRule !thumbnails - [C]
RewriteRule !public - [C]
RewriteRule !index.php - [C]
RewriteRule (.*) public/$1 [L]


How should it be written in Hiawatha style?

Thank You!

Hiawatha version: 9.4
Operating System: CentOS 6.5
Hugo Leisink
14 April 2014, 22:48
I'm no Apache expert (as you might guess), but I think it will be like this:
Match ^/favicons/(.*)$ Rewrite /data/favicons/$1
Match ^/thumbnails/(.*)$ Rewrite /data/thumbnails/$1

' I have no idea what the %1 means in index.php?%1

Match (.*) Rewrite /index.php/$1
Roman
15 April 2014, 21:56
I made this way:
UrlToolkit {
ToolkitID = selfoss
Match ^/selfoss/favicons/(.*)$ Rewrite /selfoss/data/favicons/$1
Match ^/selfoss/thumbnails/(.*)$ Rewrite /selfoss/data/thumbnails/$1
Match ^/selfoss/update$ Rewrite /selfoss/update.php
Match ^/selfoss/(.*\.(js|ico|gif|jpg|png|css|asc|txt|eot|woff|ttf|svg))$ Rewrite /selfoss/public/$1
Match ^/selfoss/(.*?)(\?.+)? Rewrite /selfoss/index.php$1$2
Match ^/selsoss/(.*)$ Rewrite /selfoss/index.php$1
}

Selfoss shows the content but not everything works (maybe some PHP errors).
Will try to fix.
This topic has been closed.