Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

500 Internal Server Error - Enhancing a Simple PHP Application

So I have a website on iPage.com and when I uploaded all my files I got the 500 Internal Server Error. I got it once when I was coding it in my wamp server but then I figured it out by enabling the Apache writeable option. Since now it's not on my local host, it's on a web hosting what can I do to fix this?

1 Answer

A lot of internal server errors can be cause by uploading a bad .htaccess file. I've done this a number of times in my career. That's probably the best starting place I can suggest to you.

The htaccess code was from the course it self..

RewriteEngine On RewriteRule ^shirts/$ /shirts/shirts.php RewriteRule ^shirts/([0-9]+)/$ /shirts/shirt.php?id=$1 RewriteRule ^receipt.php$ /receipt/ [R=301] RewriteRule ^contact.php$ /contact/ [R=301] RewriteRule ^shirts.php$ /shirts/ [R=301] RewriteRule ^(shirts/[0-9]+)$ /$1/ [R=301]

RewriteCond %{QUERY_STRING} ^id=([0-9]+)$ RewriteRule ^shirt.php$ /shirts/%1/? [R=301]

Try cutting all of that stuff out temporarily and save the .htaccess to see if that gets rid of the 500 error.

Still I get it even though I delete the .htaccess This is weird.. Any ideas?

Interesting. At that point, I'd suggest contacting your webhost support to see if they can pull any logs and tell what's triggering the error. Sorry I couldn't be more help for you on this :-/

Really appreciate your fast replys. Cheers!