Options -MultiViews
DirectoryIndex index.php

#php_value display_errors On

AddCharset UTF-8 .html
#AddHandler application/x-httpd-php-5-cgi .php
#AddHandler x-httpd-php .php
#AddType text/html php


RewriteEngine On

RewriteBase /

RewriteRule ^section/(.*).html$ structure.php?section=$1 [L]

RewriteRule ^page/(.*).html$ pages.php?id=$1 [L]

RewriteRule ^testimonials/page-(.*).html$ guestbook.php?page=$1 [L]
RewriteRule ^testimonials/index.html$ guestbook.php [L]
RewriteRule ^testimonials-index.html$ testimonials/index.html [R]
RewriteRule ^create-a-flyer.html$ create-a-flyer/2.html [L]
RewriteRule ^testimonials/added.html$ guestbook.php?added=true [L]
RewriteRule ^testimonials/(.*).html$ guestbook.php?news=$1 [L]
RewriteRule ^testimonials/$ guestbook.php [L]
RewriteRule ^testimonials.html$ guestbook.php [L]

RewriteRule ^movers/profile/(.*)/(.*)_([0-9]+).html$ profiles.php?type=movers&profile=$1&section=$2&page=$3 [L]
RewriteRule ^movers/profile/(.*)/(.*).html$ profiles.php?type=movers&profile=$1&section=$2 [L]
RewriteRule ^movers/profile/(.*).html$ profiles.php?type=movers&profile=$1 [L]
RewriteRule ^movers/profile/(.*)/$ profiles.php?type=movers&profile=$1 [L]
RewriteRule ^movers/profile/(.*)$ movers/profile/$1/ [R,L]


RewriteRule ^login.html$ members.php?login [L]
RewriteRule ^logout.html$ members.php?logout [L]
#RewriteRule ^recovery.html$ members.php?userpage [L]
#RewriteRule ^userpage.html$ members.php?userpage [L]
RewriteRule ^recovery.html$ structure.php?section=recovery [L]
RewriteRule ^userpage.html$ structure.php?section=userpage [L]


RewriteRule ^index.html$ index.php [L]
RewriteRule ^pdf/show/([A-Za-z0-9_-]+).pdf$ pdf/main.php?yourFlyer=$1&download=0 [L]
RewriteRule ^pdf/download/([A-Za-z0-9_-]+).pdf$ pdf/main.php?yourFlyer=$1&download=1 [L]

# all searchs
RewriteRule ^last-minute/page-(.*).html$ structure.php?section=last-minute&page=$1&%{QUERY_STRING} [L]
RewriteRule ^last-minute.html$ structure.php?section=last-minute&%{QUERY_STRING} [L]

RewriteRule ^storage/page-(.*).html$ structure.php?section=last-minute&page=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^storage.html$ structure.php?section=last-minute&%{QUERY_STRING} [L]
RewriteRule ^storage.html$ structure.php?section=storage&%{QUERY_STRING} [L]

RewriteRule ^commercial-moving/page-(.*).html$ structure.php?section=last-minute&page=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^commercial-moving.html$ structure.php?section=last-minute&%{QUERY_STRING} [L]
RewriteRule ^commercial-moving.html$ structure.php?section=commercial-moving&%{QUERY_STRING} [L]

RewriteRule ^long-distance-interstate-moving/page-(.*).html$ structure.php?section=last-minute&page=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^long-distance-interstate-moving.html$ structure.php?section=last-minute&%{QUERY_STRING} [L]
RewriteRule ^long-distance-interstate-moving.html$ structure.php?section=long-distance-interstate-moving&%{QUERY_STRING} [L]

RewriteRule ^rent-a-truck/page-(.*).html$ structure.php?section=last-minute&page=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^rent-a-truck.html$ structure.php?section=last-minute&%{QUERY_STRING} [L]
RewriteRule ^rent-a-truck.html$ structure.php?section=rent-a-truck&%{QUERY_STRING} [L]

RewriteRule ^piano-moving/page-(.*).html$ structure.php?section=last-minute&page=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^piano-moving.html$ structure.php?section=last-minute&%{QUERY_STRING} [L]
RewriteRule ^piano-moving.html$ structure.php?section=piano-moving&%{QUERY_STRING} [L]

RewriteRule ^moving-supplies/page-(.*).html$ structure.php?section=last-minute&page=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^moving-supplies.html$ structure.php?section=last-minute&%{QUERY_STRING} [L]
RewriteRule ^moving-supplies.html$ structure.php?section=moving-supplies&%{QUERY_STRING} [L]

RewriteRule ^moving-boxes/page-(.*).html$ structure.php?section=last-minute&page=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^moving-boxes.html$ structure.php?section=last-minute&%{QUERY_STRING} [L]
RewriteRule ^moving-boxes.html$ structure.php?section=moving-boxes&%{QUERY_STRING} [L]

RewriteRule ^moving-blankets/page-(.*).html$ structure.php?section=last-minute&page=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^moving-blankets.html$ structure.php?section=last-minute&%{QUERY_STRING} [L]
RewriteRule ^moving-blankets.html$ structure.php?section=moving-blankets&%{QUERY_STRING} [L]
#\ end all searchs

RewriteRule ^message/([0-9]+).html$ message.php?order=$1 [L]
RewriteRule ^message/([0-9]+)-([0-9]+).html$ message.php?order=$1&bid=$2 [L]
RewriteRule ^message/([A-Za-z0-9_-]+).html$ message.php?sess=$1 [L]
RewriteRule ^([A-Za-z0-9_-]+)/page-([0-9]+).html$ structure.php?section=$1&page=$2 [L]
RewriteRule ^([A-Za-z0-9_-]+)/order-([0-9]+).html$ structure.php?section=$1&order=$2 [L]
RewriteRule ^([A-Za-z0-9_-]+)/done-([0-9]+)_([0-9]+)_([0-9]+).html$ structure.php?section=$1&cur=$2&sub=$3&id=$4 [L]
RewriteRule ^([A-Za-z0-9_-]+)/done-([0-9]+)-([0-9]+)-([0-9]+).html$ structure.php?section=$1&cur=$2&sub=$3&id=$4&myevents [L]
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+).html$ structure.php?section=$1&spage=$2 [L]
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/([0-9]+).html$ structure.php?section=$1&spage=$2&cur=$3 [L]
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/([0-9]+)_([0-9]+).html$ structure.php?section=$1&spage=$2&cur=$3&orders=$4 [L]
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/([0-9]+)-([0-9]+).html$ structure.php?section=$1&spage=$2&cur=$3&num=$4 [L]
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/([0-9]+)-([0-9]+)-([0-9]+).html$ structure.php?section=$1&spage=$2&cur=$3&num=$4&orders=$5 [L]
RewriteRule ^([A-Za-z0-9_-]+).html$ structure.php?section=$1 [L]
