views:

22

answers:

2

Hi, I have two domain: asdf.com and asdf.ru (.ru is a parked domain). They are pointing to the same folder on the server. (Everything is the same, the only difference is the language). I cannot use subdirectories. Is it possible to protect the .ru domain with password, but leave unprotected the .com domain?

Thank you.

A: 

Have a look at this answer which sets some environment variables based on the hostname, which you can then use to create some conditional IfDefine blocks (in which you can try putting your access control rules)

Q: How Can I Have A Conditional .htaccess Block?

EDIT actually, it looks like you can't use rewrites to set an environment variable which you can then check with IfDefine. The two examples seem to be separate. This may only be possible if you have your own server - in which case you would be able to put the two domains in separate vhosts.

Nick
Ok, thank you. Any other possibility?
Trck75
A: 

I am trying to use this:
SetEnvIfNoCase Host ^www\.asdf\.ru$ host_ru
<IfDefine host_ru>
...protection...
</IfDefine>

But doesn't work. What could be the problem?

Trck75