WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Installing Entirely into a Subdirectory (8 posts)

  1. nathanbeach
    Member
    Posted 2 years ago #

    Hello:

    I've read a bunch in here about being able to install the WordPress core files into a custom subdirectory ("Giving WordPress its own Directory"). That is not what I'm trying to do. I'm trying to entirely install WordPress into its own subdirectory with no relation to the actual root of the domain.

    In my case, I have no control over the domain root, and cannot edit an .htaccess file there. It's set up like this:

    http://domain-i-do-not-control.com/myshare/where-i-want-wordpress

    I have it working fine on the public side for the most part, but the Admin console does weird things like redirecting to the domain root when I edit settings and click Save. Also, there are several WP functions (such as "Older/Newer Posts") that render links to "/" rather than relative to the current directory.

    From what I've read here and elsewhere, it seems I'm not going to be able to get this to work. I just wanted to check if anyone else has tried to do this and has any ideas.

    I love WordPress. Thanks!

    Nathan Beach

  2. David Choi
    Member
    Posted 2 years ago #

    It really doesn't matter if you are going to install WP in root or subdirectory, the process is exactly the same.

    The .htaccess doesn't have to be at root either, it will still work. Unless of course if there is a .htaccess at the root, that has instructions to prevent from accessing any other subdirectories.

    To let WP create .htaccess for you, just have to go to

    Admin Panel > Settings > General

    at http://yourdomain.com/wp-admin/options-general.php

    to define:

    WordPress Address (URL)
    Site Address (URL)

  3. nathanbeach
    Member
    Posted 2 years ago #

    The install part works fine, and most stuff on the site works, but there are certain WP functions that still try to hit the root of the server. For instance, the "Older Posts" link returned by the posts_nav_link function always goes to the root "/".

    Also, most functions in the Admin console will not redirect properly. For example, editing the blog title in Settings -> General, when I click "Save Changes", WP tries to redirect to the root:
    /wp-admin/options-general.php?settings-updated=true

    And I get a 404. Anyway, I think there's some stuff deep down in WordPress that's not letting this work. It's obviously not really designed to work this way, which is fine. Just wondering if anyone else has tried this.

    Thanks for your response!

    Nathan

  4. fonglh
    Member
    Posted 2 years ago #

    Your WordPress URL and Site URL settings should both be http://domain-i-do-not-control.com/myshare/where-i-want-wordpress

  5. nathanbeach
    Member
    Posted 2 years ago #

    They are both set the same. I also just tried moving the site up to "myshare", so it would be:

    http://domain-i-do-not-control.com/myshare/

    Still, the admin console functions redirect to "/" after clicking "Save Changes". I'm going to take a look at the source and see if there's anything obvious.

    Thanks for your response...

  6. Sorina Dascalu
    Member
    Posted 2 years ago #

    It's strange you get these problems. I install WordPress in sub-directories almost every month, and it works without problems.

    I even have a WordPress install on the root, another in a folder and another one in a sub-folder and everything works just fine!

    I think something went wrong during the installation with your WordPress site. The fastest way to fix that if you didn't work much on the website yet is to delete everything and re-install.

  7. nathanbeach
    Member
    Posted 2 years ago #

    I cannot get this to work. I just set up a new database and tried installing completely fresh to a different directory under my share, and at the end of install, WordPress redirects to the wrong site.

    I think this probably isn't a WordPress problem. I guess it must be something related to 1and1.com's shared SSL hosting.

    Thanks for all the help, though...

    Nathan

  8. nathanbeach
    Member
    Posted 2 years ago #

    marking as resolved

Topic Closed

This topic has been closed to new replies.

About this Topic