RewriteEngine On

RewriteBase /

###########################
##  REMOVE https	 ##
###########################
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}

###########################
##  ADD www    		 ##
###########################
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

###########################
##  RESULT AND DETAILS   ##
###########################
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*/blog|blog)/([a-zA-Z0-9_-]+)/?([a-zA-Z0-9_-]+)?/?([a-zA-Z0-9_-]+)?/?([a-zA-Z0-9_-]+)?/?([a-zA-Z0-9_-]+)?$ ./blog.php?friendly_url=$2&category2=$3&category3=$4&category4=$5&category5=$6 [L]

RewriteRule ^(.*/cat|cat)/([a-zA-Z0-9_-]+)/?([a-zA-Z0-9_-]+)?/?([a-zA-Z0-9_-]+)?/?([a-zA-Z0-9_-]+)?/?([a-zA-Z0-9_-]+)?$ ./result.php?catf_url=$2&start=$3&category3=$4&category4=$5&category5=$6 [L]

RewriteRule ^(.*/search|search)/([a-zA-Z0-9_-]+)/?([a-zA-Z0-9_-]+)?/?([a-zA-Z0-9_-]+)?/?([a-zA-Z0-9_-]+)?/?([a-zA-Z0-9_-]+)?$ ./search.php?searchkeyword=$2&start=$3&category3=$4&category4=$5&category5=$6 [L]

RewriteRule ^(.*/index|index)/([a-zA-Z0-9_-]+)/?([a-zA-Z0-9_-]+)?/?([a-zA-Z0-9_-]+)?/?([a-zA-Z0-9_-]+)?/?([a-zA-Z0-9_-]+)?$ ./index.php?page=$2&start=$3&category3=$4&category4=$5&category5=$6 [L]

############################
##  BLOCK ACCESS TO .INI  ##
############################
#<Files ~ "\.ini$">
#  Order allow,deny
#  Deny from all
#  Allow from .krisaquino.net
#</Files>
<Files 403.shtml>
order allow,deny
allow from all
</Files>

deny from 203.177.74.141
