Forums

[resolved] WP in own directory gives error 500 (6 posts)

  1. kortech
    Member
    Posted 6 months ago #

    I installed WP in a /wpdev subdirectory and used the subdirectory as my website URL. All is working fine. Now I want to leave WP in the subdirectory but change the site URL to the root. I followed the instructions in Giving WordPress Its Own Directory, editing index.php as instructed. I get server 500 errors. This is running on an IIS server, so there is no .htaccess file and I'm using default permalinks so no web.config either. I figured this had to do with the fact that I already had a non-WP web running at the root, using default.asp as the default page. So I changed the server to use index.php as the default page. Made no difference. Then I renamed default.asp. Still made no difference. I could sure use some help.

  2. Brad Markle
    Member
    Posted 6 months ago #

    Hi kortech. As 500 errors are very vague, the first step in troubleshooting them would be to find out what the actual error message is. The error message usually has the file name and line number, and that is going to be a tremendous help.

    I'm not very familiar with IIS, but I would recommend checking out first How Web site administrators can troubleshoot an "HTTP 500 - Internal Server Error" error message on IIS 4.0 or on IIS 5.0

  3. kortech
    Member
    Posted 6 months ago #

    Brad, thanks for the prompt response. Unfortunately, this is not my server and the server administrator is not being very cooperative. As I mentioned, the root web is a current non-WP production web, and I'm in the process of converting it to this new WP web, which is currently installed in my wpdev subdirectory. This is the final step to turning it on at the root.

    As a test, I created a /wpdev/test subdirectory, changed my site URL to /wpdev/test, and placed index.php there, with

    require('./../wp-blog-header.php');

    That works! So this has something to do with the way my web root is operating. Any bright ideas?

  4. Brad Markle
    Member
    Posted 6 months ago #

    Hi kortech, without the error message, I'm afraid I don't have enough experience with IIS to troubleshoot much further.

    I'm not sure if that is what you were referring to, but was what exact point does this the site break?

    For example,

    # Step 1
    # Step 2
    # Step 3
    # Step 4 - After this step, I am receiving the 500 error
    # Step 5

    What step causes the error for you and what exactly did you do in that step?

  5. kortech
    Member
    Posted 6 months ago #

    Brad, I've checked the IIS log and there is no subcode, just 500. I don't have access to the server's event log.

    As soon as I hit Save Changes in Settings / General after changing the Site URL, the web stops working and returns 500. But as I said before, if I redirect the Site URL to a subdirectory of the WP directory, it works fine.

    I'm pretty sure the problem is related to the way my root web site is operating. As you know, everything in WP goes through index.php, but that page is not called explicitly; it is called as the default page at the site. I believe my root website is somehow not executing that default page, even though I've set up the server to execute it first. So this may have to do with page caching or some server setting that I'm not aware of.

  6. kortech
    Member
    Posted 6 months ago #

    Hah! Just figured it out. In step 6 of Giving_WordPress_Its_Own_Directory under "Using a pre-existing subdirectory install", rather than using
    require('./wordpress/wp-blog-header.php');
    I had to use
    require('wordpress/wp-blog-header.php');

    Apparently the "./" doesn't refer to my web root directory. I suspect this has something to do with the configuration of my root web on the server.

Reply

You must log in to post.

About this Topic