WordPress and Redirecting Root Index.html (2 posts)

  1. Glowing Face Man
    Posted 6 years ago #


    I have wordpress installed in /blog/ and I want my domain root index.html to appear identical to /blog/welcome/, but without actually 301'ing or 302'ing, I want the URL to still display the top level domain.

    I managed to mostly pull it off by putting this in my root level index.html:
    <?php $_SERVER['REQUEST_URI'] = 'blog/welcome/'; chdir('blog'); include 'index.php'; die();?>

    And this in my root level .htaccess:
    AddHandler application/x-httpd-php5 .html

    This seems to work beautifully, except for one minor little thing, which isn't a big deal but it makes me slightly nervous. If I manually type in http://www.glowingfaceman.com/blog/welcome/ while logged in through wp-admin, I see the "Edit" link below the content, as usual. But if I go to http://www.glowingfaceman.com then I don't see the "Edit" link. Not a huge deal (I seldom use that link anyway) but it makes me wonder why exactly that's happening...

    Does it have something to do with PHP's $_SESSION variables being directory-specific maybe?

    I'm a WP newbie but hoping to learn fast :-) Thanks for helping :-)

  2. Mark Ratledge
    Forum Moderator
    Posted 6 years ago #

    So what do want as a root URL? Your domain, or /blog/welcome/ or /blog/, or what? Seems like you're using a sledgehammer; this might be much easier: Giving WordPress Its Own Directory « WordPress Codex.

Topic Closed

This topic has been closed to new replies.

About this Topic