wp admin - How to display a static HTML page while setting up a WordPress site?

admin2025-06-03  3

I just installed Wordpress. I have a non Wordpress splash page at [root folder]/index.html. I'd like to keep the splash page up while I work on skinning Wordpress. When I try to access index.php (also in the root folder), it rewrites the url to index.html. I don't see index.html in the url but the splash page is there and I never see Wordpress.

I am able to access the Wordpress admin without issue. Anyone know how I can access Wordpress without making it go live?

I just installed Wordpress. I have a non Wordpress splash page at [root folder]/index.html. I'd like to keep the splash page up while I work on skinning Wordpress. When I try to access index.php (also in the root folder), it rewrites the url to index.html. I don't see index.html in the url but the splash page is there and I never see Wordpress.

I am able to access the Wordpress admin without issue. Anyone know how I can access Wordpress without making it go live?

Share Improve this question edited Feb 9, 2019 at 0:02 fuxia 107k39 gold badges255 silver badges461 bronze badges asked Nov 29, 2012 at 15:03 4thSpace4thSpace 2671 gold badge3 silver badges9 bronze badges 1
  • 3 You could use the WordPress plugin Under Construction. – realloc Commented Nov 29, 2012 at 15:17
Add a comment  | 

5 Answers 5

Reset to default 7

Either use a plugin (like wp-maintenance-mode) or hardcode your .htaccess file to redirect to the splash page, and allow your own (or your team) IP address to ignore the redirect. Like this:

<IfModule mod_rewrite.c>

RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1
RewriteCond %{REQUEST_URI} !/splashpage.html$ [NC]
RewriteRule .* /maintenance.html [R=302,L]

</IfModule>

Regarding your doubt why index.html gets served from root, it is because it usually takes precedence over index.php. If you wanted to change that, you would have to change the DirectoryIndex.

EDIT: I thought it was obvious, but, for the sake of clarity: 127.0.0.1 should be changed to your public IP address. Also note that 302 is Temporary Redirect, which is what we want.

I feel the easiest method of achieving this is editing the .htaccess file in the root web directory, and place this at the top:

DirectoryIndex index.html index.php

That swaps the priority order in which Apache chooses which file to use.

Try this.

function temp_page_redirect() {
    if (!current_user_can('administrator')) {
        wp_safe_redirect('temp.html',307);
    }
}
add_action('template_redirect','temp_page_redirect');

I did not use index.html because because that file name has special significance to the server. The '307' is a status code meaning temporary redirect. I assumed that the 'administrator' role needs access :)

This works perfectly. Add new plugin folder with this file as index.php.

From the support thread:

"To address the original question, you can turn off canonical redirection by putting this into your plugins directory –"

<?php
/*
Plugin Name: Disable Canonical URL Redirection
Description: Disables the "Canonical URL Redirect" features of WordPress 2.3 and above.
Version: 1.0
Author: Mark Jaquith
Author URI: http://markjaquith/
*/ 

remove_filter('template_redirect', 'redirect_canonical'); 

?>

This seemed to help a lot of people there, and might be a proper answer here as well.

Try this on your htaccess file:

DirectoryIndex index.html index.php

This code means that apache will look for index.html first, and if it doesn't exist then will look for index.php

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748895337a314618.html

最新回复(0)