# Solved: HTTP 500 Internal Server Error Caused By .htaccess



## seanmt (Oct 31, 2004)

I am new to using .htaccess files and have beed using mod_rewrite.

But now the index page of my website will not load. I just get *HTTP 500 Internal Server Error*.

Other pages work. It is just the index that doesn't.

The contents of my .htaccess file:


```
<IfModule mod_rewrite.c>
   Options +FollowSymLinks
   Options +Indexes
   RewriteEngine On
   
   RewriteCond %{SCRIPT_FILENAME} !-f
   RewriteCond %{SCRIPT_FILENAME} !-d
   
   
   RewriteRule ^([a-z]+)/([a-z]+)$ $1.php?do=$2
   RewriteRule ^([a-z]+)/([0-9]+)$ $1.php?do=$2
   RewriteRule ^([a-z]+)$ $1.php 
   RewriteRule logout login.php?logout
   RewriteRule steam create.php?do=steam 
   
   RewriteCond %{http_host} ^www\.fmcard\.co\.uk [NC]
   RewriteRule ^(.*)$ http://fmcard.co.uk/$1 [R=301,NC]
   
</IfModule>
```


----------



## lordsmurf (Apr 23, 2009)

Disable the custom errors messages on the server account. 
You need to know where the error is in the code, not read the generic "hidden" message.

Some scripts disable it internally, if the server is set to show it.

"_*500*_" may as well read "_*Help me, I've fallen and I can't get up*_" -- it's a generic nothing.


----------



## scottdeagan (Feb 27, 2010)

You could tail your error log in a terminal. If you are using default install of Apache, it would be something like:

tail -f /var/log/apache2/error.log

Have you successfully enabled mod_rewrite and used it in the past? In Ubuntu, you would enable mod_rewrite by entering:

a2enmod rewrite


----------



## MMJ (Oct 15, 2006)

I had a lousy host and they didn't like certain .htaccess commands.

Try commenting those out one by one till you find the culprit. Then you can either come back here, talk to your host, or ask Google his opinion.


----------



## seanmt (Oct 31, 2004)

Sorry to waste everyones time but It had nothing to do with the htaccess. I had simply made an error in one of my echo statements. I had a trailing " where none was needed.


```
echo $variable ";
```
I just assumed it was htaccess as I had been fiddling with it when I noticed it went down.


----------



## tomdkat (May 6, 2006)

Cool. How did you find that out?

Peace...


----------



## seanmt (Oct 31, 2004)

I tried renaming the index.php file to something else and when it still wasn't working I realised it was a problem with that page so I had a good look through and spotted the error.


----------



## tomdkat (May 6, 2006)

Sounds good. 

Peace...


----------

