Forum

Htaccess Apache2 || Rewrite Hiawatha 7.5

Andreas
23 July 2011, 21:56
Hello Hugo,

I have some problems and need help to solve these .

1. Htaccess Apache2

# Backend Application Rules
RewriteCond %{REQUEST_URI} ^/backend$
RewriteRule ^backend$ backend.php/ [QSA,L,PT,NC]
RewriteCond %{REQUEST_URI} ^/backend/
RewriteRule ^backend/(.*)$ backend.php/$1 [QSA,L,PT,NC]

# WebTV Application Rules
RewriteCond %{REQUEST_URI} ^/webtv$
RewriteRule ^webtv$ webtv.php/ [QSA,L,PT,NC]
RewriteCond %{REQUEST_URI} ^/webtv/
RewriteRule ^webtv/(.*)$ webtv.php/$1 [QSA,L,PT,NC]

# we skip all files with .something
#RewriteCond %{REQUEST_URI} \..+$
#RewriteCond %{REQUEST_URI} !\.html$
#RewriteRule .* - [L]

# rewrite for vimp.swf from ostube
RewriteRule ^vimp.swf http://%{HTTP_HOST}/flash/vimp.swf [QSA,R,L]

# rewrite for flashcomm.php
RewriteRule ^flashcomm.php http://%{HTTP_HOST}/media/flashcomm [QSA,R,L]

# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f

# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]


2. Permalinks | .PHP Protektion

UrlToolkit {
ToolkitID = wordpress
RequestURI exists Return
Match .* Rewrite /index.php
Match /wp-includes/.* DenyAccess
#Match ^/wp-config.php$ DenyAccess
}

Match .*Rewrite /index.php/archives/%post_id%
[code]I´ll hope you can help me , best regards

Andreas

Hiawatha version: 7.5
Operating System: Debian 6
Hugo Leisink
26 July 2011, 00:12
It should be something like this:
VirtualHost {
...
EnablePathInfo = yes
UseToolkit = something
}

UrlToolkit {
ToolkitID = something

# Backend Application Rules
Match ^/backend$ Rewrite /backend.php
Match ^/backend/(.*)$ Rewrite /backend.php/$1

# WebTV Application Rules
Match ^/webtv$ Rewrite /webtv.php
Match ^/webtv/(.*)$ Rewrite /webtv.php/$1

Match ^/vimp.swf Rewrite /flash/vimp.swf
Match ^/flashcomm.php Rewrite /media/flashcomm

# we check if the .html version is here (caching)
Match /(.*) Rewrite /$1.html Continue
RequestURI isfile Return
Match /(.*)\.html Rewrite /$1 Continue
RequestURI isfile Return

# no, so we redirect to our front web controller
Match .* Rewrite /index.php
}


The rewrite rule for Wordpress websites can be found in the HOWTO page.
Andreas
27 July 2011, 19:28
Hello,

Using /etc/hiawatha
Reading hiawatha.conf
Syntax error in hiawatha.conf on line 111.


1. Match ^/backend$ /backend.php
2.Match ^/webtv$ Rewriten /webtv.php
3.RewriteRule .* /index.php

and without these Lines

 Configuration check via Hiawatha...
Using /etc/hiawatha
Reading hiawatha.conf
Reading mimetype.conf
Configuration OK.


Virtualhost

VirtualHost {
Hostname = www.#####.at, *.#####.at
WebsiteRoot = /var/www/#####/web
StartFile = index.php
AccessLogfile = /var/logfiles/#####.access.log
ErrorLogfile = /var/logfiles/#####.log
TimeForCGI = 5
UseFastCGI = PHP5
EnablePathInfo = yes
UseToolkit = something
#PreventCMDI = yes
#PreventCSRF = yes
#PreventSQLi = yes
#PreventXSS = yes
}


Best Regards Andreas
Hugo Leisink
27 July 2011, 21:21
I've updated the UrlToolkit rule in my previous post. Please try again.
This topic has been closed.