Hi everybody,
I've created a subdomain on my web site, which I plan to put pages in, but I don't want to make that subdomain public for a while, so for the moment, I'd like to block access to the subdomain from all IP addresses except mine with a temporary redirect to a placeholder file in the document root of the subdomain.
I thought .htaccess was the way to do it, and I made up this file in the document root of my subdomain:
Options -Indexes
RewriteEngine on
RewriteCond %{REMOTE_HOST} !^000\.000\.000\.000
RewriteRule http://subdomain.maindomain.x10hosting.com/* http://subdomain.maindomain.x10hosting.com/index.html [R=302,L]
Unfortunately, the redirect doesn't seem to be happening; the files seem to be accessed as normal. Is .htaccess the right way to do this, and if so, what am I doing wrong? I've tried Googling, and this seems right, but clearly it isn't. Can anyone give me a hand, please?
Thanks,
Lydia
I've created a subdomain on my web site, which I plan to put pages in, but I don't want to make that subdomain public for a while, so for the moment, I'd like to block access to the subdomain from all IP addresses except mine with a temporary redirect to a placeholder file in the document root of the subdomain.
I thought .htaccess was the way to do it, and I made up this file in the document root of my subdomain:
Options -Indexes
RewriteEngine on
RewriteCond %{REMOTE_HOST} !^000\.000\.000\.000
RewriteRule http://subdomain.maindomain.x10hosting.com/* http://subdomain.maindomain.x10hosting.com/index.html [R=302,L]
Unfortunately, the redirect doesn't seem to be happening; the files seem to be accessed as normal. Is .htaccess the right way to do this, and if so, what am I doing wrong? I've tried Googling, and this seems right, but clearly it isn't. Can anyone give me a hand, please?
Thanks,
Lydia