Forum

.htaccess modrewrite to hiawata rules

GentZu
24 November 2014, 09:16
Options -Indexes
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
## Redirect from non-www to www
#RewriteCond %{HTTP_HOST} !^www\. [NC]
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
## Redirect from www to non-www
#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
#RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

## Redirect from non-www to www and http to https
RewriteCond !{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

## Redirect index.php to root domain
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]

RewriteRule ^p/(.*).html$ p.php?pages=$1 [L]
RewriteRule ^search/([0-9]+)/(.*)/mp3.html$ s.php?type=a&p=$1&q=$2 [L]
RewriteRule ^search/(.*)/mp3.html$ s.php?type=a&q=$1 [L]

# Abuse Agent Blocking
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Bolt\ 0 [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ZyBorg [NC]
RewriteRule ^.* - [F,L]
# Abuse bot blocking rule end
</IfModule>

<FilesMatch "cnfg.php|direct.php|footer.php|header.php|sidebar.php|recaptchalib.php">
Order allow,deny
Deny from all
</FilesMatch>

please help me how to httaccees functions work on hiawatha
thanks

Hiawatha version: hiawatha 9.8.0
Operating System: Centos 6.6
This topic has been closed.