Archive for March, 2010

Double Home Page Problem Wordpress

Wednesday, March 3rd, 2010

Many of us Wordpress users will have come up with the double Home Page problem.

If you are using Wordpress to create a website often you want a static home page on the site and not have it default to the latest blog entry.  To do this you must log in to the admin area, go to setttings->reading and set a static page as your homepage.

Often times you will want to create this page and title it ‘Home’ however on most themes if you do this you will end up with two home pages.

To get around this, without editing the theme, you need to create a dummy static page that is hidden from public view.  Once this static page is created you must go back and edit the newly created home page and set its parent to this new dummy page.

And that should be it!

If you want to have your blogs appear on another page, simply create another static page (with no content) and again go to settings->reading and set the posts page to this page. You must do this before you make the dummy page private, however.

  • Share/Bookmark

Windows IIS, PHP & Error 500: The page cannot be displayed because an internal server error has occurred.

Wednesday, March 3rd, 2010

I was pulling my hair out this morning when I transferred my PHP Content Management System to an Windows IIS Shared Server and started getting the message Error 500: The page cannot be displayed because an internal server error has occurred.

Debugging wasn’t working, there were no syntax errors, I was stumped. So I started breaking down the code into little modules to test.

I tried printing out a variable that wasn’t initialised and low and behold the dreaded error appeared.

echo $test;

If I initialised the variable first there were no problems i.e.

$test  =  “Hello, World!”;
echo $test;

So, basically, the problem was that php was spitting out some debug warnings, however the shared hosting account was interpreting this as an internal error and hence the error message on the client browser.

An ideal fix would be to get rid of all warnings from the code, however, a quick workaround was to simply turn off error reporting altogether using the following line of code:

error_reporting(0);

Hope this helps someone out there!

  • Share/Bookmark