3

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.

enter image description here

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

enter image description here

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/

  • 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 Oct 1 '16 at 10:51
  • Yes I followed the instructions by wp-beginner. updating the question. – Anurag Rana Oct 1 '16 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 Oct 1 '16 at 13:49
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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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