WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Installing WP in subdirectory..? (7 posts)

  1. Bliss7
    Member
    Posted 7 years ago #

    Hi, to all WP users here. Can someone point out the best way to direct all domain/site requests to WP in a subdirectory?
    I have a domain that is best used as an ezine/news site. However I want to add a blog to it with WP like this: http://mydomain/blog/
    As right now I'm short of money and still trying to figure out how to start an ezine, I decided to focus on developing the blog part of my yet to be ezine for the time being....
    Since I dont want to upset the URLS later in the Search Engines...I want to make the home or index page of my site to point to my blog as in http://mydomain/blog/ and direct all visitors to the blog, and focus on my blog writing.

    I've heard htaccess can be used, as in using the command "DirectoryIndex"....

    However I'm not sure if that method will work right with the WP permalinks and its structure.
    Does anyone know whats the best thing to do, as I believe using DirectoryIndex in htaccess works best for .html pages and not sure if it will work for WP since WP permalinks are usually like this: http://rootdomain/2006/12/6/post-title
    and dont show any page.html structure.

    How do I make http://mydomain/blog as the default index page? Advice much appreciated.

  2. Samuel B
    moderator
    Posted 7 years ago #

    A simple way to do that would be to install WP in the directory you want and have the index.php in the root of your site.
    Read about it here:
    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    Then when you are ready with the other, simply move your index - read about it here:
    http://codex.wordpress.org/Moving_WordPress#Moving_WordPress_Within_Your_Site

  3. Bliss7
    Member
    Posted 7 years ago #

    Thanks Samboll, good info there.

  4. Bliss7
    Member
    Posted 7 years ago #

    Dear Samboll,

    I forgot to ask if its normal for WP not to update the htaccess automatically, once I have installed WP in a subdirectory. I've installed WP in http://mydomain/blog

    where all the WP files reside in the /blog folder and I also made a copy of htaccess and index.php and left it in the root http://mydomain

    I followed the instructions as in

    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    to the letter, and now when I want to update the permalinks, WP tells me to copy the code it displays at the bottom and overwrite the htaccess in the root directory(that also has the index.php). (the Manual way).

    Previously (before moving the core files to the subdir), it could always update the permalinks by itself.

    Is it true now I have 2 htaccess and 2 index.php, one in the new subdirectory and the other in the root directory?

    Thanks for any clarifications...:)My htaccess file is totally 777 writable.

  5. Bliss7
    Member
    Posted 7 years ago #

    One nore thingy is although I copied all the WP files into the /blog folder, but the url still displays as http://mydomain

    although I want it to display as

    http://mydomain/blog

    as the homepage of the blog.

    Can someone help me out? Thanks

  6. Bliss7
    Member
    Posted 7 years ago #

    So much for the fuss, I figured out that the permalinks get updated automatically, once I change the blog and wordpress URI as http://mysite/blog
    and use permalinks custom structure as /blog/2006/12/31/postname

    The only problem remaining is how to redirect everyone to the /blog automatically? Although I fixed the posts to follow the URLs like above and starting with /blog/post-name...

    yet http://mysite/ will show a 404 page and doesnt redirect to the /blog/ directory....

    Can someone advise? Is it a totally htaccess file thing? Thanks in advance and have a Happy New Year

  7. Rok
    Member
    Posted 7 years ago #

    All you'v to do is, open your index.php in the root folder and look for the under quoted line:

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

    and change this with:

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

    Note: Remember to change ./blog with the actual folder name, where your WordPress core files are residing.

Topic Closed

This topic has been closed to new replies.

About this Topic