disabling wordpress until you built your site
I like using wordpress for content management on websites.
Sounds pretty generic, right? It is.
What I do, is I log into my freaking shell (who would want a hosting acount without ssh?), and wget the latest wordpress ..
$ wget http://wordpress.org/latest.tar.gz
$ unzip latest.tar.gz
Then it expands to wordpress/….
Then I actually replace my public_html with that.
$ mv ~/public_html ~/public_html_old
$ mv ./wordpress ~/public_html
Great, after you setup your install.. You can go to http://yoursite.com and see the generic wordpress stuff.
What if this is a production site, and you need to see all your php stuff working, but you want everybody else to see a custom index.html- something that says .. hey… we’re not done- come back later.
Create your public_html/index.html right alongside public_html/index.php
You’ll notice that still doesn’t do it.
Edit your .htaccess file..
$ vim ~/public_html/.htaccess
And add…
RewriteEngine On
RewriteCond %{QUERY_STRING} !.*attachment
RewriteRule ^$ /index.html [R=302,L]
# (underneath is wordpress htaccess entries.)
That should do it.
You should still be able to go to http://yoursite.com/pagename and see your code.
The attachment line is because I personally use attachment view for media, if you don’t have that, it won’t redirect to index.php instead of index.html.
When you’re ready to go live, remove the entries from your .htaccess file.
Read more about apache mod rewrite.
