WordPress.org

Support

Support » Installation » [Resolved] WordPress Development Environment

[Resolved] WordPress Development Environment

  • 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.

Viewing 15 replies - 1 through 15 (of 18 total)
  • 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

    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.

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

    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

    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.

    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.)

    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.

    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.

    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.

    ok, will look into the ht access –

    Thank you for your help everyone!

    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.

    Ah, I see now.

    ok – great info, I’ll do some digging.

    Thank you.

    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.

    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.

    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’);
    ?>

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘[Resolved] WordPress Development Environment’ is closed to new replies.