mod_rewrite help

I have a wordpress site. I would like to be able to intercept all requests to the root of the site http://www.mysite.com and redirect to another page. However if a link is made to any internal page (i.e. www.mysite.com/index.php/2010/whatever) it will follow the typical WP conventions.

Here is the .htaccess file


# BEGIN WordPress RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress

# BEGIN WPSuperCache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
AddDefaultCharset UTF-8
RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]

RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
</IfModule>
# END WPSuperCache


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Options All -Indexes
</IfModule>

Is there a way to direct a root request to a page such as index.html and all other requests go through ./index.php?

Thanks in advance for any assistance or help provided.

comfixit,

Yes, don’t have those pages on your website as

RewriteCond &#37;{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

will prevent linking away from those pages.

Okay, I didn’t go through all the other nonsense before the “standard” WP mod_rewrite. What’s all that for?

Finally, if you are a webmaster, you MUST know not to leae the <IfModule> tests in your .htaccess as that is requiring the test (for mod_rewrite) to be executed - TWICE - for every file request! That’s seriously abusive of your server.

Regards,

DK