1

I want to start using Silex on Apache and according to silex docs I need to insert this code into my .htaccess file

<IfModule mod_rewrite.c>
    Options -MultiViews

    RewriteEngine On
    #RewriteBase /path/to/app
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [QSA,L]
</IfModule>

However I already have this code above it, which works fine:

# www.foo.com will point to foo.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.foo\.com$
RewriteRule ^/?$ "http\:\/\/foo\.com\/" [R=301,L]

Can I omit RewriteEngine on?

Furthermore b.c. rewriting already has been verified to work can I remove the IfModule statement?

They don't explain what the code does in their docs so any explanation would be helpful.

Zen-Lee Chai
  • 361
  • 1
  • 3
  • 10
  • 2
    Yes, the `` is [mostly pointless/detrimental](http://stackoverflow.com/a/31280108#~begone). And no, a single `RewriteEngine On` does per .htaccess file. – mario Jul 08 '15 at 15:38

0 Answers0