admin管理员组

文章数量:1122846

I installed wordpress in /wp/ directory. So in my blog every URL had /wp/ in it. I followed multiple articles(1,2) and was able to remove the 'wp' from URLs.

before - example/wp/post-1-name after - example/post-1-name

In permalink settings I have selected -

post name - /

Now every url I open do not have /wp/ in it. Except front page.

In 'reading settings' I also set the 'front page display' to 'a static page' and selected lets say 'Introduction' as the front page.

When I open urls in browser all urls except home page (example) works fine but when I open homepage or click on the page url of "introduction" page (which is static front page), a message is shown -

This Website is Under Construction.
Come Back Soon.

Going to / shows 'not found' page.

In my general settings -
WordPress Address (URL) ->
Site Address (URL) ->

Index.php file content in root public_html directory.

<?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( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );

Content of index.php file in public_html/wp/ directory:

<?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( dirname( __FILE__ ) . '/wp-blog-header.php' );

content of .htaccess file in root public_html directory

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

content of .htaccess file in public_html/wp/ directory

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Any suggestions how can I load the front page on home url?

1
2 /

I installed wordpress in /wp/ directory. So in my blog every URL had /wp/ in it. I followed multiple articles(1,2) and was able to remove the 'wp' from URLs.

before - example.com/wp/post-1-name after - example.com/post-1-name

In permalink settings I have selected -

post name - http://example.com/sample-post/

Now every url I open do not have /wp/ in it. Except front page.

In 'reading settings' I also set the 'front page display' to 'a static page' and selected lets say 'Introduction' as the front page.

When I open urls in browser all urls except home page (example.com) works fine but when I open homepage or click on the page url of "introduction" page (which is static front page), a message is shown -

This Website is Under Construction.
Come Back Soon.

Going to http://example.com/wp/ shows 'not found' page.

In my general settings -
WordPress Address (URL) -> http://example.com/wp
Site Address (URL) -> http://uptuplacements.com

Index.php file content in root public_html directory.

<?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( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );

Content of index.php file in public_html/wp/ directory:

<?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( dirname( __FILE__ ) . '/wp-blog-header.php' );

content of .htaccess file in root public_html directory

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

content of .htaccess file in public_html/wp/ directory

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Any suggestions how can I load the front page on home url?

1 https://codex.wordpress.org/Changing_The_Site_URL
2 http://www.wpbeginner.com/wp-tutorials/how-to-get-rid-of-wordpress-from-your-wordpress-site-url/

Share Improve this question edited Oct 1, 2016 at 18:11 J1. 4314 bronze badges asked Oct 1, 2016 at 9:03 Anurag RanaAnurag Rana 1511 gold badge1 silver badge5 bronze badges 3
  • The "under construction" banner is loaded somehow by uptuplacements.com/index.php. Are you sure you followed the instructions by wp-beginner to upload a modified index.php file to the root directory of your wordpress site (not to /wp/)? – adelval Commented Oct 1, 2016 at 10:51
  • Yes I followed the instructions by wp-beginner. updating the question. – Anurag Rana Commented Oct 1, 2016 at 12:48
  • I think "under construction" is loaded from your root index.php file try to find your root index.php file and update index.php with upper code that you mention. also have a look [askwpgirl.com/… – Amit Mishra Commented Oct 1, 2016 at 13:49
Add a comment  | 

1 Answer 1

Reset to default 2

Finally solved the issue.
Index.html file in /public_html/ directory was conflicting with index.php file.

This awesome article solved the issue.
askwpgirl.com/moving-wordpress-from-subdirectory-to-root-faq/

本文标签: migrationUnable to load static front page on home url