Reputation: 166
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
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