Forum

Convert Apache RewriteRule to Hiawatha ?

Daniel
1 March 2015, 10:25
Hi, can anyone help

how to do i this Apache RewriteRule convert to ToolkitID Rewrite:


RewriteEngine on

# first reverse domain names order
RewriteRule ^/([^/]*?)\.([^/.]+)(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?/ab2p.css$ /$9/$8/$7/$6/$5/$4/$3/$2/$1/ab2p.css [N]

# then try to get CSS for current domain
# if it is unavailable - get CSS for parent domain
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule (^.*/+)[^/]+/+ab2p.css$ $1ab2p.css [N]
</VirtualHost>

is this possible on hiawatha ?

Thanks,
sorry for my English


Hiawatha version: hiawatha 9.12
Operating System: Debian
Hugo Leisink
1 March 2015, 10:51
It will be something like this:
# first reverse domain names order
UrlToolkit {
Match ^/([^/]*?)\.([^/.]+)(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?(?:\.([^/.]+))?/ab2p.css$ Rewrite /$9/$8/$7/$6/$5/$4/$3/$2/$1/ab2p.css
RequestURI isfile Return
Match /(^.*/+)[^/]+/+ab2p.css$ Rewrite /$1ab2p.css
}
This topic has been closed.