WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Installing WP in root - coexisting with other folders (16 posts)

  1. Wilma_Wilma
    Member
    Posted 3 years ago #

    Hi all!
    I've done a redesign of our site's blog on an off-site location. This redesign has a static frontpage that will be the landingpage of our site.

    I now want to install this redesign (as a fresh WP install) in our site's root directory but I'm told this cannot be done and that it will have to be installed in a subdirectory (blog).

    But if I understand correctly, then the static WP frontpage will NOT be the landing page for our site, but rather the existing index.html file that is currently in the root directory. I'm told that our main http://www.----.com should be redirected to http://www.---.com/blog and that no one will notice that our landingpage will read http://www.---.com/blog and that essentially http://www.----.com and http://www.----.com/blog will be the same thing. Then the blog (the page I created for it in my redesign) will then be http://www.----.com/blog/blog.

    I don't particularly like this and although I'm not a WP expert, I don't think that's needed either.

    My client tells me a WP install cannot be done in a directory that has already folders in it (for x-cart, forum, etc.) and that there is no way to redo an entire site restructure without taking the entire site offline and that if I'd want to install WP in the root directory (to make sure that my static WP frontpage is our site's landing page), I'd have to delete everything in there and empty the directory.

    I think this is simply not true. Am I correct in thinking this?

  2. s_ha_dum
    Member
    Posted 3 years ago #

    Strictly speaking it isn't true. You can have other things in the root directory with WordPress. You should be happy to hear that. :)

    However... whether you can, in this particular case, install WordPress in the root directory depends upon what else you have installed and what its file and directory names are. For example, if something else already has an index file in root you are going to have trouble, and you did mention index.html. Is it possible to get rid of that? Incompatible .htaccess rules can be an issue also. It is unlikely that anything installed in a sub-directory will be a problem unless it installs something else in root, like an index file or an .htaccess file.

    The good news is that you may be able to do what you want but the answer depends on the specifics of your existing setup.

  3. govpatel
    Member
    Posted 3 years ago #

    No matter how you install you can only have one index file in folder weather is root or directory and wordpress use index.php
    You can still use wordpress in root as you want and you will need to create a template with out any side bars and use that as your landing page(frontpage)

  4. Wilma_Wilma
    Member
    Posted 3 years ago #

    Thank you both!

    Yes, there is an index.html file in the public_html directory. It is the current landing page of the site (basically a logo with mapped buttons to click through to the main sections of the site: store, forums, blog). The idea to set up a WP site with a static front page was to get rid of this existing landing page, so I guess it can be deleted (together with another couple of .html files like the 404 page - which are also now included in the WP setup.

    Not sure whether there is a .htaccess (if it's there, I guess it's hidden), but it is a good point to check.

    Govpatel: why must that static front page be without sidebars? I've set up a static front page like a newspaper page. This works great in my test environment (which has WP in public_html but it's the only thing installed there).

  5. govpatel
    Member
    Posted 3 years ago #

    I said that if you want to have one like the landing page have now is option.

    if you have a link to blog in your index.html landing page then you can install wordpress in blog folder set it all up and change link in landing page.

  6. s_ha_dum
    Member
    Posted 3 years ago #

    If you can replace that index file you can probably get this to work.

    Be aware that you may have to edit WordPress's .htaccess to get some of your other software to work. WordPress might be too greedy about file and directory names. You might-- but might not-- have to add lines so that certain patterns are not redirected. But I think it should work.

  7. Wilma_Wilma
    Member
    Posted 3 years ago #

    Thanks again! You are very helpful!

    The current blog does not have pretty permalinks and I understand that in this case, there may not be a .htaccess file. I wanted to have pretty permalinks in the new WP structure, but if not having those would avoid possible .htaccess clashes, I'll do without. I wouldn't be confident enough to edit such a file or even know what to put in it if there were to be a conflict.
    Currently the other things in the root (all in their own subdirectories) are x-Cart, forum (vBulletin), the current blog (WP), image gallery.

  8. s_ha_dum
    Member
    Posted 3 years ago #

    You don't need the .htaccess file for the default link structure, but you may as well switch on the pretty permalinks just to see if you have an issue before giving up on them. At least then you'd know for sure.

  9. Wilma_Wilma
    Member
    Posted 3 years ago #

    I'm following this here: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    It mentions moving the .htaccess file to the root, but there already is an .htaccess file in there. If I understand you rightly, I can ignore moving the WP .htaccess file and just move the index.php (from the blog directory) to the root? And then follow the instructions in the above link when I switch to pretty permalinks and get a warning that the .htaccess file cannot be written to?

  10. Wilma_Wilma
    Member
    Posted 3 years ago #

    Here's what's in the existing .htaccess file (in the public_html directory) if it helps:

    DirectoryIndex default.html default.htm index.html index.htm index.php

    and this is what's in the .htaccess file that's currently in the existing blog directory (after I changed the permalinks - it didn't give me a problem):

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>

    # END WordPress

  11. Wilma_Wilma
    Member
    Posted 3 years ago #

    Reading this again, I think my earlier post on NOT moving the WP .htaccess file is wrong and I should move it. I guess my question should have been ... is there anything in the current htaccess file that I should copy to the WP .htaccess file and if yes, WHERE do I put it. Or can I just delete that current htaccess file (with the directory stuff in it). I hope I still make sense! I'm on a learning curve (and thankful for your help! stuff like this is a bit scary when you do it for the first time).

  12. govpatel
    Member
    Posted 3 years ago #

    DirectoryIndex default.html default.htm index.html index.htm index.php

    You need change that
    to

    DirectoryIndex index.php default.html default.htm index.html index.htm

    so that it opens index.php if it finds one if not move to next one.

  13. s_ha_dum
    Member
    Posted 3 years ago #

    You can try with the WordPress default .htaccess, and maybe it will work, but the existing .htaccess file suggests that you will need to take the DirectoryIndex line provided by govpatel and put it at the top of the WordPress .htaccess.

  14. Wilma_Wilma
    Member
    Posted 3 years ago #

    WOOOHOOO .... I'm very happy :-) just did everything that you two suggested and it seems to have worked just fine. I need to redo a link or two, but it's looking good! Thank you so very much for your patience and help! I learned a thing or two and one day I hope to be able to share what I learned with others, just the way you two did.

  15. govpatel
    Member
    Posted 3 years ago #

    You are welcome

  16. s_ha_dum
    Member
    Posted 3 years ago #

    No problem. Happy to help.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.