htaccess interferes with virtual host

I'm using WampServer on a Windows 7 platform.  Yesterday I modified my .htaccess in order to redirect requests for my website with the www prefix to the non-www version, and also redirect requests for index.htm to the root landing page.  After making these changes, I can't access my site through virtual host.  The Apache error log contains this entry:

.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

Here is the .htaccess code.  The AdaptiveImages portion is unchanged, and did not result in this issue:

<IfModule mod_rewrite.c>
  Options +FollowSymlinks
  RewriteEngine On

  # Adaptive-Images -----------------------------------------------------------------------------------

  # Add any directories you wish to omit from the Adaptive-Images process on a new line, as follows:
  RewriteCond %{REQUEST_URI} !js
  RewriteCond %{REQUEST_URI} !css
  RewriteCond %{REQUEST_URI} !scgi
  RewriteCond %{REQUEST_URI} !secure  
  RewriteCond %{REQUEST_URI} !assets
  RewriteCond %{REQUEST_URI} !images/view.jpg
  RewriteCond %{REQUEST_URI} !images/StWVT.jpg
  RewriteCond %{REQUEST_URI} !images/StWVTsmall.jpg
  RewriteCond %{REQUEST_URI} !images/TdwVT.jpg
  RewriteCond %{REQUEST_URI} !images/TdwVTsmall.jpg

  # don't apply the AI behaviour to images inside AI's cache folder:
  RewriteCond %{REQUEST_URI} !ai-cache
   
  # Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories
  # to adaptive-images.php so we can select appropriately sized versions
 
  RewriteRule \.(?:jpe?g|gif|png)$ adaptive-images.php

  # END Adaptive-Images -------------------------------------------------------------------------------
</IfModule>


# redirect requests with www prefix
RewriteEngine on
RewriteCond %{HTTP_HOST} !^mauitradewinds.com [NC]
RewriteRule ^/?(.*)$ http://mauitradewinds.com/$1 [L,R=301]

RewriteEngine On
RewriteBase /

# redirect index.htm to the root domain
RewriteRule ^index\.htm$ / [NC,R,L]
ddantesAsked:
Who is Participating?
 
GaryConnect With a Mentor Commented:
Sounds like the mod_rewrite module is not enabled
In httpd.conf look for mod_rewrite.so and remove the # from the beginning of that line
0
 
ddantesAuthor Commented:
Perfect.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.