Why doesn't my htaccess redirect work?

Posted by cosmicbdog on Server Fault See other posts from Server Fault or by cosmicbdog
Published on 2012-07-10T06:37:47Z Indexed on 2012/07/10 9:17 UTC
Read the original article Hit count: 244

Filed under:
|
|

I have setup a simple htaccess redirect which looks like this (this is the whole .htaccess file):

Options +FollowSymLinks

RewriteEngine On

Redirect 301 /something http://something.com/something.php

If I then load the site which contains this .htaccess, ie, myredirectsite.com/something I end up with the following 404:

The requested URL /something was not found on this server.

Apache/2.2.3 (Red Hat) Server at myredirectsite.com Port 80

And the logs:

[Tue Jul 10 14:25:46 2012] [error] [client xx.xx.xxx.xx] File does not exist: /home/sites/scp/something

Something is not a file, and something does not exist. I have assumed I could use Redirect the same as a Rewrite but it looks like the redirect needs to be for a file that actually exists?

I created the file 'something' and it just attempts to load the blank file. No redirect.

What am I missing in getting this working?

© Server Fault or respective owner

Related posts about apache2

Related posts about .htaccess