0

I am having a bit of trouble moving a local WP site live and into a subdirectory. I want a static homepage for now (index.html in the root folder) while I work on the live site (would be found in root/folder/, so website.com/subfolder/).

Following these steps I've had success installing WP into the root folder, but it doesn't work for a subdirectory. I was wondering if someone could walk me through how to get it to work, so I have a static homepage and am able to work on the WP site live. My host is dreamhost.

1

Since you want to test out your existing(local) site on the server; you have done the right thing as far as I can see on pastebin except for 1 thing

On step 10 - you replaced all occurances of "localhost" with your servername. Instead you should have replaced it with servername/directoryName.

If you still have issues, please let me know the exact issue you are facing and if possible the URL to your website on your host.

EDIT: The issue that OP was facing was unable to connect to database. So the solution was to update DB details in the wp-config.php file.

  • @srihari- I actually did do that, but it didn't work – vytfla Sep 5 '13 at 0:00
  • @vytfla So, when you access servername/directory what do you get? Browser's default 404 or Wordpress 404? – Srihari Sep 5 '13 at 0:07
  • If I followed the steps above, I get an error when I try the search and replace script – vytfla Sep 5 '13 at 0:53
  • Please share the error. Do you have Multisite activated? can you share the link. Later on you can have the directory password protected. – Srihari Sep 5 '13 at 1:02
  • 1
    @srihari- Thank you so much, that worked. Wasn't aware I had to do that, I didn't have it in my notes. I'm so relieved. Thank you for sticking by and helping me out. – vytfla Sep 6 '13 at 18:05
0

If you want to use a static HTML homepage you have a few options.

Move the site out of the server root directory

Move the entire site into a sub-directory like "blog", "dev", etc.

Moving the site will require updating the database and all the other things that go along with moving a site to a new domain.

Leave the site at the server root directory

Option 1

Use an htaccess file to redirect based on IP.

You can create an HTML homepage and use your htaccess file to redirect anybody that does not have your IP address. Do not name the HTML page index, home or default because these may override index.php. In this example I use homepage.html.

Upload the file to the root directory where Wordpress is. Add the following code to your .htaccess file at the very top. Replace the IP address with your own (what is my IP?), replace the domain name with your own, and change the page name if you didn't use homepage.html.

# BEGIN maintenance
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/homepage\.html$
RewriteRule ^(.*)$ http://www.example.com/homepage.html [R=307,L]
RewriteCond %{REMOTE_ADDR} !^00\.000\.000\.000
</IfModule>
# END maintenance

Option 2

Use a plugin to control maintenance mode.

I have used the one called Maintenance Mode without problems. If you are logged in you can see everything on the front-end and back-end of the site. If you are not logged in you get the maintenance page.

This is by far the easiest solution and will make launching the site a breeze when it's time to go public with it.

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.