Is it possible to dynamically change the domain name used in an .htaccess file?

Hi

I run 2 different domains from the same website, 1 targets the UK, and 1 the US.

Is it possible to change the domain name used in the .htaccess file dynamically depending upon which domain is typed into the address bar?
e.g.

RewriteCond %{HTTP_REFERER} !^http://www.domainname.com.$ [NC]
to
RewriteCond %{HTTP_REFERER} !^{dynamic domain name used in address bar}.
$ [NC]

Thanks for any / all replies

Cheers

well i think you could actually do this with php by a simple condition. But i have not done this, it is mostly theory on my end. But you must have a apache rewrite rule to re-direct all request to the index. then once the request hits the index immediately grab the url with $_SERVER and run a quick check condition on it. Based on that condition(if url is a do this else is b do this ) then the rest could be functions writting rules or use php file operations.

Yes. Have a look at the sample code in my signature’s tutorial.

Regards,

DK