Wordpress Index.php not loading : apache2 server

I’m a newbie here. I installed a wordpress in a server run by Apache2. But the wordpress doesn’t load index.php page. I can access deshboard and all other categories are displaying well. but the home url is not loading the index.php. Eventhough i try to added /index.php at the end of url, still it’s not working. It just display 404 error. When i look at the theme directory and wordpress directory there are (index.php) files.

so I googled for solution. some suggested to add [directoryindex index.php] in .htaccess file. I did that and that result in 500 internal server error.

Some post in google suggest to look at dir.conf and httpd.conf under Apache2. In my httpd.conf file, I have this line of code

SSLcertificateChainfile /etc/ssl/certs/secure_yosalasd_org.ca-bundle

In my dir.conf file, I have this lines of code

<IfModule mod_dir.c>
DirectoryIndex index.php index.html

I would appreciate if anyone can figure out what is the problem here.

thank you so much in advance




Welcome to SitePoint.

DirectoryIndex index.php index.html default.asp whatever

… would be the correct code (and not cause any 500 errors).

What you did not show was your WP .htaccess code which has some minor problems which need to be addressed (but should have given you index.php, anyway), i.e., REMOVE <IfModule> wrappers and RewriteBase / and RewriteCond %{REQUEST_URI} index\.php as each causes a different problem. In the RewriteRule, I prefer .? to just ., too. There are explanations throughout WP threads but I’ll repeat them here on request.



sorry to highjack this post.

i ran in to a similar issue: after adding DirectoryIndex line, it gave me 500 server error.
anyone know how to fix it? Thanks.

# BEGIN WordPress
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /panelcreative/staging/
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /panelcreative/staging/index.php [L]

# END WordPress
DirectoryIndex /index.php


First, welcome to SitePoint.

Second, it’s bad etiquette to hijack a thread - better to start your own.

Third, DirectoryIndex is an Apache core directive which needs a series of files WITHIN THE DIRECTORY which should be served (ordered by order of precedence, the first found will be the one served) so your / is a syntax error (which causes the 500 error status).

Finally, your mod_rewrite also has some major problems:

First, NEVER use an <IfModule> wrapper in an .htaccess file. Yes, WordPress used that but only to prevent nastygrams from “webmasters” who didn’t realize that the module was not available. However, to use the <IfModule>, you’ll be ABUSING the server by asking it to test module support several times for each and every file request. That always draws my Standard Rant #4:

[rant #4][indent]The definition of an idiot is someone who repeatedly does the same thing expecting a different result. Asking Apache to confirm the existence of ANY module with an <IfModule> … </IfModule> wrapper is the same thing in the webmaster world. DON’T BE AN IDIOT! If you don’t know whether a module is enabled, run the test ONCE then REMOVE the wrapper as it is EXTREMELY wasteful of Apache’s resources (and should NEVER be allowed on a shared server).[/indent][/rant 4]

Then, since you’ve installed WP in a subdirectory, the RewriteBase handles the redirection to that subdirectory, i.e., do not include it in the redirection!

# BEGIN WordPress
[COLOR="#FF0000"]<IfModule mod_rewrite.c>[/COLOR]
RewriteEngine On
RewriteBase /panelcreative/staging/
[COLOR="#FF0000"]RewriteRule ^index\\.php$ - [L][/COLOR]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .[COLOR="#0000FF"]?[/COLOR] [COLOR="#FF0000"]/panelcreative/staging/[/COLOR]index.php [L]

# END WordPress
DirectoryIndex [COLOR="#FF0000"]/[/COLOR]index.php