srinath
srinath

Reputation: 166

Rewrite rules for blocking URL access

I have two sites,

www.example.com and offers.example.com

Now i want the site - offers.example.com to be accessed only through www.example.com

i.e., I dont want to give public access to offers.example.com...

Can i achieve this through rewrite rules?

or do i have to do this through PHP code?

Please suggest?

Upvotes: 1

Views: 101

Answers (1)

dogmatic69
dogmatic69

Reputation: 7585

you can not do that with php code as the second page viewed will not have the www. referer

you will need to build some sort of authentication with php or use .htpasswd and only allow users with logins to go there.

http://httpd.apache.org/docs/2.0/programs/htpasswd.html

http://php.net/manual/en/features.http-auth.php

Upvotes: 1

Related Questions