WordPress.org

Forums

[resolved] WordPress Development Environment (19 posts)

  1. doug123x
    Member
    Posted 4 years ago #

    Hi There -

    I've successfully installed wordpress on my site, but while I am populating the pages and so forth, I uploaded a "coming soon" default.htm, with the hopes of previewing the site through the index.php (and keeping the two seperate, until I remove the default.htm, which would then turn control over to wordpress). However, WordPress (index.php) is redirecting to the default.htm. If I remove the default.htm, the WordPress site works, but this defeats the purpose. I don't want potential clients seeing the work in progress until it is completed.

    http://www.sampledomain.com/default.htm (interm "coming soon" message)
    http://www.sampledomain/com/index.php (wordpress redirector)

    Is this approach correct? Any input would be appreciated.

  2. govpatel
    Member
    Posted 4 years ago #

    Have tried to keep permalinks to default see if it still redirects.

    Other option try and use your place holder as index.html as that first page will open on most servers for the domain name and if there is not index.html it will look for index.php

  3. doug123x
    Member
    Posted 4 years ago #

    Just tried a permalink and it doesn't bring up the WordPress blog.
    http://www.sampledomain.com/?p=123

    I don't want the wordpress blog to load when someone hits the site - at least not now. I want to build the site & test the site using a "private" address and then when I am ready to go live, flip the switch. (which in this case is simply removing default.htm - afterwhich the wordpress site loads)

    Thank you for your input.

  4. doug123x
    Member
    Posted 4 years ago #

    Anyone? Surely this request can't be that unique.

  5. govpatel
    Member
    Posted 4 years ago #

    You can set it all up in folder make it a password protected folder and you can work on wordpress set it all up once you ready to make it live move wordpress to root.

    http://codex.wordpress.org/Moving_WordPress

  6. Brig01
    Member
    Posted 4 years ago #

    This is what I do while I develop sites.

    Just put this in your htaccess file (the one in your site root):

    ### MAINTENANCE REDIRECTION ###
    Options +FollowSymlinks
    RewriteEngine On
    RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.123
    RewriteRule !^maintenance/ http://www.yourdomain.co.uk/maintenance/ [R=302,L]

    Replace 123\.123\.123\.123 with your IP address. (If you don't have a static IP you might have to change this when your modem resyncs)
    You can add as many IP addresses as you want by adding more RewriteCond lines.

    Then create an index file in /maintenance/ with your under construction message.

    When you're done with the site just comment this section out in the htaccess file and keep it for when you need to do any future work.

  7. doug123x
    Member
    Posted 4 years ago #

    Thank you for the replies guys.

    I've already setup WordPress in the root of my web-site.

    Why cannot I not do the following? (aside from the issue I am having with the index.php redirecting to the index.htm which I do not understand.)

    http://www.somedomain.com/index.php(and view the wordpress site during development)
    http://www.somedomain.com/index.htm(what the visitors see, until I remove it, afterwhich index.php takes over and wordpress becomes live)

    I am not concerned about security (i.e., if someone purposely wanted to see the "development" site.)

  8. Brig01
    Member
    Posted 4 years ago #

    If you're on apache then it's most likely down to your virtual host settings.

    Usually there's a line in the virtual host file that defines what file and which order the web server should serve up by default such as index.php then index.html then index.htm.

    You would have to edit this to make index.htm the default.

    The line usually looks like this:

    DirectoryIndex index.php index.html index.htm

    I think the htaccess solution I posted above would be easier for you and if you're on a normal hosted service and not on your own server then it might be the only solution unfortunately.

  9. doug123x
    Member
    Posted 4 years ago #

    Thank you for the response.

    My apologies if I did not articulate this very well, but the issue I have is that:

    http://www.somedomain.com/index.php for some reason redirects to http://www.somedomain.com/index.htm (default.htm)

    I looked at the code in the wordpress index.php and don't see why this is redirecting.? When I visit index.php I expected this to load the wordpress site. When I visit index.htm (which is the default), I expect the static html page to load.

  10. Brig01
    Member
    Posted 4 years ago #

    Sounds like something in your htaccess file redirects. Shouldn't happen though as WP wouldn't add that by itself.

    Have a look through your htaccess anyway to be sure.

    Just tested on my dev site and as long as I set index.htm to be default index file I can access that and can access the WP site by specifying /index.php.

    Sorry I can't help more on that issue.

  11. doug123x
    Member
    Posted 4 years ago #

    ok, will look into the ht access -

    Thank you for your help everyone!

  12. It's probably your server settings, actually.

    Servers are set up to render pages in an order. Index.html, then home.html etc etc. Yours probably has default.htm before index.php, and either way, you can't have TWO index files in the same folder without having issues.

    Shortest answer: On some servers, you can't have BOTH index.php and default.htm in the same folder.

  13. doug123x
    Member
    Posted 4 years ago #

    Ah, I see now.

    ok - great info, I'll do some digging.

    Thank you.

  14. Brig01
    Member
    Posted 4 years ago #

    Still shouldn't redirect if you specify for example default.htm in the URL. Those server settings are just in which order the server should serve pages. Unless there are some odd server settings your hosts have done.

    This is how it works on my server:

    In the virtual hosts setting:
    DirectoryIndex index.php index.html index.htm

    The server will look for index.php first, if that doesn't exist then look for index.html and so on. But it only does that if you don't specify the file in the URL.

    For example http://www.domain.com/ would pick index.php if it exists otherwise look for index.html then index.htm

    http://www.domain.com/index.html will always serve index.html even though index.html is second in order.

  15. doug123x
    Member
    Posted 4 years ago #

    This is what I had originally thought, because for example the current index.php could be renamed bob.php and it shouldn't redirect.

    Here is the site - this may help:

    http://www.keystonemasonry.com/default.htm which is the same as http://www.keystonemasonry.com

    and

    http://www.keystonemasonry.com/index.php (wordpress)

    Note the strange redirection.

    If I delete default.htm - the wordpress site kicks in and life is good.

  16. doug123x
    Member
    Posted 4 years ago #

    I'm going to follow the code through and see what happens. Seems like it's the wordpress engine that loads the default.htm file

    Index.php code (pretty basic)

    <?php
    /**
    * Front to the WordPress application. This file doesn't do anything, but loads
    * wp-blog-header.php which does and tells WordPress to load the theme.
    *
    * @package WordPress
    */

    /**
    * Tells WordPress to load the WordPress theme and output it.
    *
    * @var bool
    */
    define('WP_USE_THEMES', true);

    /** Loads the WordPress Environment and Template */
    require('./wp-blog-header.php');
    ?>

  17. govpatel
    Member
    Posted 4 years ago #

    It's probably your server settings, actually.

    Servers are set up to render pages in an order. Index.html, then home.html etc etc. Yours probably has default.htm before index.php, and either way, you can't have TWO index files in the same folder without having issues.

    Shortest answer: On some servers, you can't have BOTH index.php and default.htm in the same folder.

    That is why I suggested to install in a folder and keep your under construction page in root.

    After all just takes few minutes to move wordpress from folder to root.

  18. doug123x
    Member
    Posted 4 years ago #

    I should have done this much earlier on - however - renaming index.php to bob.php causes the wordpress site to appear and the default.htm to be left alone happily.

    I think this confirms the post provided by govpatel.

    Thank you.

  19. scvbruce
    Member
    Posted 3 years ago #

    My server says:

    This is the order of precedence for the default files on your Linux Standard account:
    1.default.html
    2.default.htm
    3.index.php
    4.index.shtml
    5.index.html
    6.index.htm
    7.home.html
    8.home.htm
    9.index.php5
    10.welcome.html
    11.welcome.htm

    But, like some other folks, when I enter the domain name followed by index.php, it takes me to default.htm.
    I was able to change index.php to myindex.php and the it allows me to go to the WordPress php page.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.