301 re-direct htaccess linux

If you use Rewrite rather than Redirect you can have a RewriteCond that will exclude the index.html, something like:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^index\.html$
RewriteRule /(.*) http://your.other.domain/$1 [R=301]

The '!' negates the regex that follows, (regex = the bit between '^' and '$'), so it means don't Rewrite index.html. Note the '\.', the dot needs to be escaped with a '\' inside the regex.

Can't guarantee that will work, but hopefully move you in the right direction.
 
Upvote 0

Latest Articles