WordPress.org

Ready to get started?Download WordPress

Forums

control web root index.php from wordpress in subdir (4 posts)

  1. shunluoifong
    Member
    Posted 5 years ago #

    I have a question about organizing my site so that the site homepage (public_html/index.php) is controlled by WP when WP is installed in a subdirectory (public_html/blog). I understand that I can install WP in public_html/blog and have the blog home page in public_html/index.php. However, I want the blog home page to be displayed in public_html/blog/index.php, not public_html/index.php. But I do want public_html/index.php to still be controlled by WP so that I can use the WP header/footer/variables/methods in public_html/index.php.

    Perhaps a clearer way to ask this...Is there a way to set it up so public_html/index.php is treated like a custom "page" (in the WP sense) when the blog is installed in a subdirectory (public_html/blog) and the blog home page is located in (public_html/blog/index.php)?

    To summarize, I would like my structure like so...

    1. public_html/blog -> installation directory of WP
    2. public_html/blog/index.php -> the home page of the blog
    3. public_html/index.php -> the home page of the site, controlled by WP, perhaps like a "page" (in the WP sense).

  2. shunluoifong
    Member
    Posted 5 years ago #

    I think I need to further clarify my question...

    I noticed that when I install WP in public_html/blog, and create "pages" (in WP sense), for example "biography", "contact", etc., the url structure sticks "blog" in front of the pages, i.e.

    http://www.example.com/blog/biography/
    http://www.example.com/blog/contact/

    However, I would like all pages, still controlled by WP, to have their own url without "blog" in the path, i.e.

    http://www.example.com/biography/
    http://www.example.com/contact/
    http://www.example.com/portfolio/

    So here is where I am at...I would like everything controlled by WP, but WP is installed in a subdirectory of root (public_html/blog), and the url structure is a little more semantically correct.

    public_html/blog -> install dir for WP
    public_html/blog/index.php -> home page of blog
    public_html/index.php -> site home page controlled by WP
    http://www.example.com/biography/ -> bio "page" controlled by WP
    http://www.example.com/contact/ -> contact "page" controlled by WP
    http://www.example.com/portfolio/ -> portfolio index page controlled by WP
    http://www.example.com/portfolio/section1/ -> specific subsection of portfolio, controlled by WP

    I get the sense I am making this way more complicated than it needs to be. Any advise would be greatly appreciated.

  3. Russell Heimlich
    Member
    Posted 5 years ago #

    I know this post is 6 months old but I'm interested in doing the same thing. Did you ever solve your problem?

    I know you can easily install WordPress to a subdirectory and still control the root index page like this -> http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    I'm just stumped on moving the blog index to a subdirectory.

  4. Russell Heimlich
    Member
    Posted 5 years ago #

    I figured it out. Here's how I did it -> http://wordpress.org/support/topic/300599?replies=8#post-1176511

Topic Closed

This topic has been closed to new replies.

About this Topic