Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8231553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:31:59+00:00 2026-06-07T17:31:59+00:00

I find myself migrating a static site to a WordPress-based website fairly frequently these

  • 0

I find myself migrating a static site to a WordPress-based website fairly frequently these days. Once I’ve finished development of the WordPress website on a test server, I then want to install it on the current website domain, but without affecting the old static site- until the site goes live.

My idea is to move the current non-WordPress website to a folder /old/ and get all requests to rewrite to this folder (and so for SEO purposes keeping all the urls the same).

To allow myself and other authorized people through I want to check for a cookie (that will be set via a simple “login” php file since I can’t rely on static IP addresses) or if the current date and time is after the live date then let the WordPress rewrite rules take their course to give access to the WordPress website.

This will also allow me to add a simple countdown timer on the current or old site after which the new site will go live automatically at live date.

My simple login.php script is like this:

<?php
setcookie("login", "loggedin", time()+3600,"/");
?>
<h3>Welcome, you are logged in</h3>
<p><a href="/">Click here to visit the home page</a></p>

I thought the following might be the best way to acheive this, but it doesn’t work (I get a Internal Server Error). The first section checks to see if the login cookie exists and if it doesn’t and the current date and time is before 8pm on July 20 2012 it will rewrite all requests to the /old/ folder. I’ve modified the WordPress rewrite section to exclude the /old/ folder.

RewriteCond %{HTTP_COOKIE} !^.*login.*$ [NC]
RewriteCond %{TIME} < 20120720200000
RewriteCond %{REQUEST_URI} !^/old/
RewriteRule (.*) http://domain.com/old/$1 [L]

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

Can someone help me with what I want to achieve?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:32:00+00:00Added an answer on June 7, 2026 at 5:32 pm

    The RewriteCond directive takes 2 arguments, but you are giving it 3 when comparing %{TIME} and that’s causing apache to return a 500 server error.. If you look at the lexicographical comparisons in RewriteCond, there can’t be a space after the comparitor (mod_rewrite is kind of dumb like that). So that line needs to look like this:

    # no space here -----V
    RewriteCond %{TIME} <20120720200000
    

    That should deal with the 500 server error.

    The other thing about your rules is that the rule’s target, http://domain.com/old/$1, will cause apache to 302 redirect because you are including the http://domain.com in the target. If you want it to rewrite internally (so the URL in the browser’s address bar doesn’t change), you need to remove that bit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I find myself a little baffled here. I'm fairly new to android/java development so
I find myself using this method a ton to perform actions based on a
I find myself frequently repeating HTML code to format items such as lists, tables,
I find myself constantly learning new things in web development and there is always
I find myself choosing between the two following design patterns a lot: static {
I find myself running scripts and copy-pasting the output of these runs into emails
I find myself struggling with the fuzz around the concept of string-based 'Service Locators'.
I find myself having to get around waiting for AJAX in jQuery often these
I find myself typing import numpy as np almost every single time I fire
I find myself often having to reposition subviews of a view after hiding or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.