I have a site that I’m planning to launch soon but it requires some private testing.
Eventually I would be using this code to automatically re-write domain.com/folder as domain.com. The code I will be using is this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC]
RewriteCond %{REQUEST_URI} !^/folder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /folder/$1
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC]
RewriteRule ^(/)?$ folder/index.php [L]
But for the time being I am running a pre-launch signup page using launchrock.com. For this to operate I have added a CNAME entry into my DNS to resolve launch.domain.com to the launch page on launchrock. I have also set up my .htaccess with the following code to resolve domain.com to launch.domain.com meaning that any visitors to the site are shown the launch page rather than “access denied”.
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://launch.domain.com/$1 [R=302,L]
Trouble is, this also rewrites the /folder link to the launchrock page. For the duration of beta, I would like to allow my testers to be able to access the website in it’s current state at domain.com/folder by using login details set out by .htpasswd while public visitors going to domain.com are shown the launchrock page.
Could you folks offer any advice? What’s the best way of doing this?
Put an index.html with a redirect to launch.domain. something like:
in the HEAD of a blank HTML.
All users coming to http://www.domain.com or domain.com will be redirected to launch.domain.com but not the ones going to domain.com/folder/