I’m getting some intermittent issues with a website running FastCGI and htaccess (under Plesk). I wanted to check my htaccess isn’t doing anything silly before I go kick my host(!) so wondered if someone would mind a quick sanity check on my htaccess?
# ----------------------------------------------------------------------
# Start rewrite engine
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and
# features. FollowSymLinks must be enabled for this to work.
# Some cloud hosting services require RewriteBase to be set: goo.gl/HOcPN
# If using the h5bp in a subdirectory, use `RewriteBase /foo` instead where
# 'foo' is your directory.
# If your web host doesn't allow the FollowSymlinks option, you may need to
# comment it out and use `Options +SymLinksIfOwnerMatch`, but be aware of the
# performance impact: http://goo.gl/Mluzd
<IfModule mod_rewrite.c>
Options +FollowSymlinks
# Options +SymLinksIfOwnerMatch
RewriteEngine On
# RewriteBase /
</IfModule>
# ---------------------------------------------------------------------
# SEO Preservation - The SEF Preservation society!
# ---------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)category=Bouquets(.*)$
RewriteRule (.*) /section/5/1/bouquets? [L,R=301]
RewriteCond %{QUERY_STRING} ^(.*)category=Bereavements(.*)$
RewriteRule (.*) /section/29/1/bereavement? [L,R=301]
RewriteCond %{QUERY_STRING} ^(.*)category=Exclusive(.*)$
RewriteRule (.*) /section/24/1/exclusive? [L,R=301]
RewriteCond %{QUERY_STRING} ^(.*)category=Modern(.*)$
RewriteRule (.*) /section/11/1/modern? [L,R=301]
RewriteCond %{QUERY_STRING} ^(.*)category=Arranged(.*)$
RewriteRule (.*) /section/10/1/arranged? [L,R=301]
RewriteCond %{QUERY_STRING} ^(.*)category=Roses(.*)$
RewriteRule (.*) /section/6/1/roses? [L,R=301]
RewriteCond %{QUERY_STRING} ^(.*)category=Spring(.*)$
RewriteRule (.*) /section/28/1/spring_time? [L,R=301]
RewriteCond %{QUERY_STRING} ^(.*)category=Hand(.*)$
RewriteRule (.*) /section/5/1/bouquets? [L,R=301]
RewriteCond %{QUERY_STRING} ^(.*)category=Birthdays(.*)$
RewriteRule (.*) /section/27/1/birthday? [L,R=301]
RewriteCond %{QUERY_STRING} ^(.*)category=Plants(.*)$
RewriteRule (.*) /section/19/1/plants? [L,R=301]
RewriteCond %{QUERY_STRING} ^(.*)category=Christmas(.*)$
RewriteRule (.*) /section/21/1/bouquets? [L,R=301]
RewriteCond %{QUERY_STRING} ^(.*)category=Mother(.*)$
RewriteRule (.*) /section/16/1/mothers_day? [L,R=301]
RewriteCond %{QUERY_STRING} ^(.*)category=Valentine(.*)$
RewriteRule (.*) /section/15/1/valentines? [L,R=301]
RedirectMatch 301 ^/weddings\\.asp$ /article/17/wedding_flowers
RedirectMatch 301 ^/weddings-intro\\.asp$ /article/17/wedding_flowers
RedirectMatch 301 ^/weddings-photographers\\.asp$ /article/20/wedding_photography
RedirectMatch 301 ^/weddings-prices\\.asp$ /article/18/wedding_prices
RedirectMatch 301 ^/weddings-reception\\.asp$ /article/19/wedding_venues
RedirectMatch 301 ^/viewproduct\\.asp$ /
RedirectMatch 301 ^/find-us\\.asp$ /page/contact
RedirectMatch 301 ^/about-us\\.asp$ /article/24/about_bumblebeez_florist
RedirectMatch 301 ^/location\\.asp$ /page/contact
RedirectMatch 301 ^/news\\.asp$ /page/social
RewriteCond %{HTTP_HOST} !^www\\.bumblebeezflorist\\.com$ [NC]
RewriteRule ^(.*)$ http://www.bumblebeezflorist.com/$1 [R,L]
</IfModule>
# ----------------------------------------------------------------------
# JShop SEF URLs
# ----------------------------------------------------------------------
<IfModule mod_rewrite.c>
Options +SymlinksIfOwnerMatch +MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?)/(.*?)$ $1.php?$2 [NC]
</IfModule>
# ----------------------------------------------------------------------
# Custom 404 page
# ----------------------------------------------------------------------
# You can add custom pages to handle 500 or 403 pretty easily, if you like.
# If you are hosting your site in subdirectory, adjust this accordingly
# e.g. ErrorDocument 404 /subdir/404.html
ErrorDocument 404 /templates/bumblebeez/404.html
ErrorDocument 500 /templates/bumblebeez/500.html
# ----------------------------------------------------------------------
# UTF-8 encoding
# ----------------------------------------------------------------------
# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset iso-8859-1
# Force UTF-8 for a number of file formats
AddCharset iso-8859-1 .atom .css .js .json .rss .vtt .xml