Forum Moderators: phranque
Any comments would be greatly appreciated.
Thanks in advance.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /index.php
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.php? [NC]
RewriteRule ^(([^/]*/)*)index\.php?$ [mysite.net...] [R=301,L]
RewriteCond %{HTTP_HOST} ^mysite\.net [NC]
RewriteRule ^(.*)$ [mysite...] [R=301,L]
</IfModule>
Using IfModule containers can lead to 'silent' failures, so it should only be used if you want to skip the enclosed code without generating any errors or warnings when the enclosed directives require a module which is not loaded.
With an IfModule in place, the code simply won't execute, so the function it implements won't work. Without the IfModule, the server will throw an error if the code contains a directive for an unloaded module. So, it's up to you to decide whether to use IfModule or not.
Jim