SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    May 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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
    </IfModule>


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

    thank you so much in advance

    regards

    Khun

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,604
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    Khun,

    Welcome to SitePoint.

    Code:
    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.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Member
    Join Date
    Jan 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /panelcreative/staging/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /panelcreative/staging/index.php [L]
    </IfModule>

    # END WordPress
    DirectoryIndex /index.php

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,604
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    sb,

    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]
    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).
    [/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!

    Code:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /panelcreative/staging/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .? /panelcreative/staging/index.php [L]
    </IfModule>
    
    # END WordPress
    DirectoryIndex /index.php
    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •