Put wordpress on a site with an existing page.
So I had this site that already had a page up. I needed to install wordpress in the root and make some changes but I didn’t want wordpress to be live to the general public…after asking in 4 forums and not getting help I figure this out. I was thinking I should use .htaccess but I solved this with a stand alone page and a cookie checker added to the themes header.php
Here’s the good:
- Moved my current page from www.site.com to www.site.com/sub/
- Created a page accessible only to me on the site that sets and destroys a cookie in the root directory using something like this:
$action = $_GET['action']; if ($action == "create") { setcookie("dealvilletempcookie123", "yes", time()+(60*60*24*365),"/"); } if ($action == "destroy") { setcookie("dealvilletempcookie123", "no", time()+(60*60*24*365),"/"); } - In the header.php file of the WP theme I check the cookie.
If its set to YES then I do nothing (which opens the WP install in the root directory)
If its set to NO (or not set or set to anything else) then I use the PHP header function to redirect…do this at the very top of the header file, before you load an WP stuff. ITS THE LAW!
Whoop…there it is.
Recent Posts
- IE, Forms, Image Submit Buttons = Bad Mojo
- A good .htaccess file
- It’s the little things
- Converting a site to WP but doing the right SEO stuff
- 301 Redirect and Canonicalization
Categories
- Android
- Cookies
- CSS
- Droid 2
- FireFox
- General Nerdiness
- God
- HTML
- IE8
- Internet Explorer
- Introduction
- Javascript
- jQuery
- Mexico
- Photoshop
- PHP
- Random Thoughts
- SEO
- Spyware
- Virus
- Web Design
- Win7
- Wordpress
