• jsnpdy

    (@jsnpdy)


    Hello,

    I set up my WordPress blog in a subdirectory to have a clean/tidy root directory but now am unsure what to do with the main domain.

    WordPress is in sitename.com/wp but the main domain shows ‘index of’
    I was thinking of just using a 301 redirect from main domain to the /wp
    URL which is fine for now while I’m building the site but ultimately would like to have a real page there.

    Maybe an ‘intro’ page with logo and basic info with a link to enter the site.

    The problem is, without WordPress on the main root directory what can I use to build a page there and then link it or integrate it with the rest of the site?

    Thank You

Viewing 7 replies - 1 through 7 (of 7 total)
  • linux4me2

    (@linux4me2)

    I’m not sure why you wouldn’t want WordPress to be in the root directory because it seems like having WordPress in the root would be much better for search engine results than using a landing page, but if that’s what you want there are a variety of things you can do.

    You can simply create an index.php or an index.htm to put in your root directory, then put whatever content you want on it using a combination of PHP (for an index.php) and HTML5/CSS to create whatever you want.

    I wouldn’t recommend a 301 redirect in the root if you are thinking this will be a temporary situation. I’d just plop an index.php in there with PHP redirecting to your WordPress install:

    <?php
      $url = "http://sitename.com/wp/";
      header('Location: ' . $url);
    ?>

    That way, when you want something in the root, you can just delete that index.php and have it change instantly without having to worry about search engines updating links, etc.

    Thread Starter jsnpdy

    (@jsnpdy)

    Hi,

    Thanks for answering.

    Well, after searching around the web on articles and forums, it seemed
    a good idea to use a subdirectory for keeping the root directory clean and uncluttered.

    I’m not sure about search engine results. If my home page were sitename.com/wp then I would use that to build links to as well as to inner pages with that same structure so I don’t think that would be an issue.

    Of course if I built a ton of links to the naked home page without the /wp that would be somewhat of a waste as a single stand alone page.

    I tried that code and it works great (thanks!) but I don’t see the difference between that and the 301 redirect I already tried which does the same thing just as efficiently.

    Can you explain the benefits of one over the other?

    Thank You

    linux4me2

    (@linux4me2)

    The 301 redirect tells search engines that the sitename.com URL has been permanently changed to sitename.com/wp, and everyone should update their bookmarks/links to the new URL. Since what you’re doing may not be permanent, you still want people visiting your root directory in case you end up using it, which was what made me suggest using PHP.

    Not only that, but when you do start using your root directly, all you have to do is delete that index.php file, and there’s no need to wait for search engines to realize your root URL actually is there again.

    If it were a permanent change, the 301 would make more sense.

    Of course, there’s also the 302 redirect, which is a temporary redirect you could use in your .htaccess…

    Thread Starter jsnpdy

    (@jsnpdy)

    Ok,

    Thanks, I understand much better now why the php option is better.

    What is your opinion of the root vs sub-directory issue for WordPress install?

    Any benefits to the root version that outweigh the organizational benefits of sub-directories?

    If it’s just cosmetic that’s fine, but if there are SEO and/or linking benefits then I’d prefer to know now while in planning stage.

    Thank You

    linux4me2

    (@linux4me2)

    I am not an expert, but I have built a lot of landing pages for clients over the years, and without exception they have all eventually decided to move WordPress back into the root directory and abandoned the landing page because it adds a layer–and a click–before the client gets to their content.

    It also means that the search ‘bots have to go an additional layer before getting to your dynamic content, and it’s your dynamic content that boosts your site’s search engine ranking, so I think it makes sense to have it immediately visible.

    I believe in keeping things simple, and installing in the root directory is just simpler. Even if you add things like a forum or some other web applications later, it makes more sense to me to put them in a subdirectory/subdomain rather than WordPress because WordPress is the SEO champ as far as I have seen.

    I’ve also seen some people who prefer to have their WordPress files outside of the root directory. There’s even a Codex article on how to do it; however, I don’t see the point. Once you’ve done a few WP sites, you’ll be used to all the directories/files that WP uses, and the root directory won’t seem cluttered anymore; you’ll easily be able to spot non-Wordpress stuff.

    Thread Starter jsnpdy

    (@jsnpdy)

    That sounds like good advice.

    Being inexperienced now, the thought of tons of files in root getting out of
    control sounds scary but I think you’re right after gaining some experience and confidence I shouldn’t have any problems.

    The additional layer and click is a good point as well.

    I think you just changed my mind. lol

    Thanks again, I appreciate your responses and taking the time to help!

    linux4me2

    (@linux4me2)

    LOL You’re welcome. It’s just my opinion, and there will undoubtedly be others. : )

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Orphaned Root Domain’ is closed to new replies.