WordPress.org

Ready to get started?Download WordPress

Forums

temporary edit of .htaccess for root install of new wp site - feedback please! (4 posts)

  1. 5high
    Member
    Posted 1 year ago #

    Hi everyone!

    I'm trying to do what lots of others do - by developing a new wp main site and then moving it/redirecting it/renaming it so that it becomes the new fully-fledged site: in much the same way as Aedryan Methyus discussed in his thread 'Installing WordPress In Root With Existing HTML Site?'.

    I've read heaps of the codex and forum posts about it, and as my new site will have lots of contents/image links etc I'm not 100% certain of my skills to ensure that I'll put in 'relative' links in absolutely everything (as was a excellent solution by New Nine.

    However, something that was said in this thread about using the htaccess file gave me an idea, and I'd just like to check out what more experienced coders thought about this solution...

    My current 'old' site is all .htm/.html pages, except for a newer contact.php page.
    And I believe that ALL wordpress posts and pages are .php files (??)

    So this is what I've trialed:
    1. Old site runs as normal +
    2. New install of w/press in Root of my site:
    So all new wordpress site will have the correct final url's, with no extra subdirectories so the urls look clean, and with no need to change any urls later.
    BUT the main problem is I can't access my new home page for design and review (and I can't do this on my local test server because 1 really important plugins can't be loaded onto a localhost).
    So...
    3. I added in a line of code into my main .htaccess file in my site root (via the editor on my cPanel), namely:
    DirectoryIndex index.php index.html index.htm
    to bring up my wordpress home.php page first so that I can review it, rather than the default .html page.

    Well, it certainly seemed to work, and obviously I can only do this for quick reviews before removing the code again from the .htaccess file. Also I think that's possibly all I then have to do when I want to change from my old site to my new one??

    Does this sound reasonably OK, code wise? I'd really appreciate feedback on this, as I'm happier using css and html and don't really understand the other file types - just do what others suggest!

    Also if it is an OK 'fix', then it's really super easy for anyone that has access to their cPanel, and might be a useful option for others, like myself.

    Looking forward to any comments. Thanks.

  2. 5high
    Member
    Posted 1 year ago #

    Would really appreciate a comment from anyone who's expert on site design and .htaccess files - preferably before I commit to a potentially risky plan for the whole of my new site!
    Thanks - hopefully...

  3. If you need an expert, consider hiring one. Otherwise, you gets what you gets with the volunteers here.

    I'd just install WP in a subfolder and build it all there. You can then run it out of that subfolder later on, by using the 'Giving WP it's own directory' set up, or moving it to root. Both are, IMO, easier than the index file changs, which doesn't work for all plugins.

  4. 5high
    Member
    Posted 1 year ago #

    Thanks for your comments Ipstenu. I thought moving files was more likely to break links in plugins?? - hence the plan to not have to actually move any of them, just change the selection order for the index pages in the .htaccess file file.

    I also wanted a clean look to all site pages' URLs, so wanted it all in the root, rather than a subfolder, which would then show in the URL - at least that's what I presume happens even after a the steps in "Giving WordPress Its Own Directory"?

    Actually, I do appreciate that the help here is from the gifting of someone's free time and knowledge - and it is always much appreciated. But one of the reasons I posted this, is because I thought it was potentially an excellent, clean 'fix' for what is obviously a common issue for many wordpress users - probably not website designers who do heaps of them - but definitely for those like me who are just trying to change their own site... so for the benefit of others too and the development of this excellent product.

Topic Closed

This topic has been closed to new replies.

About this Topic