0

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?

2
  • 1
    You probably have this error with another rule in your .htaccess file. can you show us your .htaccess? Commented Oct 16, 2011 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 Commented Oct 16, 2011 at 18:12

2 Answers 2

0

You are using a relative URI.

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

See the documentation

0

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.

4
  • I have access to a cgi-bin directory above the public directory. Don't know if that helps. Commented Oct 16, 2011 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 Commented Oct 16, 2011 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.) Commented Oct 16, 2011 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). Commented Oct 17, 2011 at 1:00

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.