Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an .htaccess file in the root directory of my domain that contains only the following:

//301 Redirect Old File
Redirect 301 /showex.php /erase.php

The two files mentioned above exist and are in the root directory. However, when I upload this .htaccess file to my root directory, the entire domain stops loading and instead I get the following message:

Internal Server Error

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

here's my .htaccess file:

AddHandler Extension_Type .html .htm .php3 .php4
Action Extension_Type /cgi-bin/php.dat
Options -Indexes
ErrorDocument 404 /404.html
AddType 'text/html; charset=ISO-8859-1'

Redirect 301 /showex.php mydomain.com/erase.php

Can someone please tell me what is wrong (or perhaps missing) in my .htaccess file?

share|improve this question
1  
You probably have this error with another rule in your .htaccess file. can you show us your .htaccess? –  Book Of Zeus Oct 16 '11 at 13:56
    
Here is the complete htaccess fileAddHandler Extension_Type .html .htm .php3 .php4 Action Extension_Type /cgi-bin/php.dat Options -Indexes ErrorDocument 404 /404.html AddType 'text/html; charset=ISO-8859-1' html Redirect 301 /showex.php mydomain.com/erase.php –  user997869 Oct 16 '11 at 18:12
add comment

migrated from stackoverflow.com Oct 28 '11 at 12:36

This question came from our site for professional and enthusiast programmers.

2 Answers

You are using a relative URI.

The new URL should be an absolute URL beginning with a scheme and hostname

See the documentation

share|improve this answer
add comment

Try to change your redirect rule in this way:

Redirect 301 /showex.php http://www.yourdomain.com/erase.php

Where obviously www.yourdomain.com has to be changed with your website. Check and let me know if it works.

share|improve this answer
    
I have access to a cgi-bin directory above the public directory. Don't know if that helps. –  user997869 Oct 16 '11 at 18:13
    
Here's what I just tried... AddHandler Extension_Type .html .htm .php3 .php4 Action Extension_Type /cgi-bin/php.dat Options -Indexes ErrorDocument 404 /404.html AddType 'text/html; charset=ISO-8859-1' html Redirect 301 /showex.php mydomain.com/erase.php –  user997869 Oct 16 '11 at 18:14
    
When I use your suggested redirect rule, the htaccess file no longer crashes my site -- however the page does not redirect either. (Sorry about the multiple comments but I'm not used to a comment form in which the "enter" button enters the comment on the first click as opposed to moving the cursor down the line to start a new paragraph.) –  user997869 Oct 16 '11 at 18:17
    
what is the full relative URL of /showex.php ? if it is /dir1/showex.php I think you've to include that too. (You can edit your comments for 5 minutes, there is an edit link). –  stivlo Oct 17 '11 at 1:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.