简体   繁体   中英

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

ie, 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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM