Hi pete!
A sanity check, eh? Okay, comments embedded in your code.
Code:
# First, because mod_rewrite is handled AFTER all core directives,
# I'd move the core directives, like DirectoryIndex and ErrorDocument to the start
# ----------------------------------------------------------------------
# Start rewrite engine
# ----------------------------------------------------------------------
# Remove comments (once you understand them)
# 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
# INSANE TO HAVE THIS CHECKED MULTIPLE TIMES FOR EVERY FILE REQUEST<IfModule mod_rewrite.c>
# SHOULD be in httpd.conf, not .htaccess Options +FollowSymlinks
# Options +SymLinksIfOwnerMatch
RewriteEngine On
# WORTHLESS RewriteBase /
# </IfModule>
# ---------------------------------------------------------------------
# SEO Preservation - The SEF Preservation society!
# ---------------------------------------------------------------------
# AGAIN??? <IfModule mod_rewrite.c>
# [standard rant #4]The definition of an idiot is someone who repeatedly does the same thing expecting a different result. Asking Apache to confirm the existence of ANY module with an <IfModule> ... </IfModule> wrapper is the same thing in the webmaster world. DON'T BE AN IDIOT! If you don't know whether a module is enabled, run the test ONCE then REMOVE the wrapper as it is EXTREMELY wasteful of Apache's resources (and should NEVER be allowed on a shared server).
No, I'm NOT calling you an idiot, simply advising against server abuse!
[/standard rant #4]
# AGAIN? RewriteEngine On
# For the series below, if you're not going to use the (.*) in the RewriteCond statements,
# Simply use .? and drop the start and end anchors. On second thought, simply drop
# the start and end anchors and your regex will match the text in the string as you're trying to do.
# For the (.*) in the RewriteRule, simply replace them with .? as all you want is a match and redirect.
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 is part of mod_alias, i.e., a core directive so
# move to top as these will ALWAYS be run before the mod_rewrite
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]
RewriteRule .? http://www.bumblebeezflorist.com%{REQUEST_URI} [R=301,L]
# Again, all you want is a match and the {REQUEST_URI} variable has the request.
# I believe that the default for R is 302 (temporary) and you do want a 301 (permanent) redirect
#</IfModule>
# ----------------------------------------------------------------------
# JShop SEF URLs
# ----------------------------------------------------------------------
OMG! AGAIN AND AGAIN! <IfModule mod_rewrite.c>
Options +SymlinksIfOwnerMatch [COLOR="#FF0000"][+MultiViews # Always a "problem child"/COLOR]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?)/(.*?)$ $1.php?$2 [NC]
# You've GOT to be kidding!
# </IfModule>
# Apache core directives to the end
# ----------------------------------------------------------------------
# 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
[/QUOTE]
Regards,
DK
Bookmarks