.htaccess Redirect causes Internal Server Error

.htaccessapache-2.2redirect

.htaccess

Redirect /index2.html http://example.com/index.html

causes the following error

Internal Server Error
The server encountered an internal error or misconfiguration 
and was unable to complete your request.

I think syntax of Redirect in this .htaccess is correct because this .htaccess works on another server.
What is the cause of this error?

Best Answer

The only thing I've found that reliably causes this type of error is when mod_alias (aka alias_module) isn't loaded for some reason. It's usually loaded by default, but could be disabled by the administrator.

You could check whether that's the case by changing your .htaccess to:

<IfModule alias_module>
    Redirect /index2.html http://example.com/index.html
</IfModule>

If you don't get the error, then mod_alias is not loaded, so the Redirect directive is unavailable.

If you still get the error, then it's something else. Realistically, you'd need the error log to see what happened.

Related Topic