Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
2  
You could use the WordPress plugin Under Construction. –  realloc Nov 29 '12 at 15:17

4 Answers 4

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.

share|improve this answer
2  
As I can't comment on other people answers, I would just like to state that I really like @s_ha_dum answer but you should be careful as the Wordpress Codex clearly states: Do not pass a role name to current_user_can(), as this is not guaranteed to work correctly. –  Sunyatasattva Nov 29 '12 at 15:25
    
I tried your suggestion and it has not effect. I want index.html to display. I also want to manually access the Wordpress page index.php. But that causes the redirect to index.html. I'm not sure why you are saying "redirect to the splash page". That's exactly what I don't want to happen. Even if I completely clear .htaccess, I still end up with rewrites. –  4thSpace Nov 29 '12 at 15:43
    
@Sunyatasattva, the source code says "@param string $capability Capability or role name.". I wonder when that was added to the Codex, or by whom? –  s_ha_dum Nov 29 '12 at 17:13
    
@4thSpace As far as I had understood you wanted to have full access to Wordpress without it going live and redirect users that are not allowed to a custom splash page which you called index.html. When I said "redirect to the splash page" I meant redirect other users to the splash page, not yourself. First of all, for my suggestion to work, have you edited the 127.0.0.1 to your public IP? –  Sunyatasattva Nov 29 '12 at 18:08
    
Yes - I did change my public IP. –  4thSpace Nov 29 '12 at 18:15

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

share|improve this answer

This works perfectly: http://wordpress.org/support/topic/how-can-i-turn-off-wordpress-indexphp-redirect-to-domain-root#post-951409. Add new plugin folder with this file as index.php.

share|improve this answer
    
Lone link is considered a poor answer (see FAQ) since it is meaningless by itself and target resource is not guaranteed to be alive in the future. Please try to include at least summary of information you are linking to. –  Rarst May 26 '13 at 19:21

Here is the simplest way to do it without modifying too many files. With just a single php page and an HTML iframe you are set to go... check the complete tutorial and codes here ... http://allnigeriansinspain.com/blog/?p=184

share|improve this answer
1  
How does this answer the question? –  s_ha_dum Apr 7 '13 at 2:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.