我目前在我的domain上已设置了一个着陆页,该页面已收到访问量。
I currently have a landing page setup on my domain which already receives traffic.
不久后它将被在线商店取代。我需要将该商店上载到我的实时服务器上,以便获得商户设施提供商(MFP)的批准,并且他们要求可以从domain上的最终实时位置访问该商店,以便获得批准。在获得批准之前,我无法让用户访问此网站。
It will shortly be replaced with an online store. I need to upload this store to my live server in order to get it approved by the Merchant Facility Providers (MFP), and they require it to be accessible from it's final live location on domain in order to get approvals. I can't have users access this site until it has met approvals.
要完成此操作,我希望将所有domain流量重定向到domain/holding/对于MFP访客。
To accomplish this I wish to redirect all domain traffic to domain/holding/ except for MFP visitors.
理想情况下,这将受到IP地址的限制,但是MFP表示他们将需要授予多个外部方访问权限,因此基于IP地址的访问将
Ideally this would be restricted by IP address, however MFP say they will need to grant a number of external parties access, and so IP address based access will not be acceptable and I should use passwords.
所以我的问题是,如何将所有流量从domain自动重定向到保留页面domain/holding/除非他们已经使用domain/login上的密码登录? 不应要求访问domain的用户输入密码。
So my question is, how can I automatically redirect all traffic from domain to the holding page domain/holding/ unless they have logged in using a password at domain/login? Users visiting the domain should not be asked for a password.
仅使用.htaccess / .htpasswd就能做到吗? 如果是这样,有人可以建议其工作方式的逻辑吗?
Will this be possible using just .htaccess/.htpasswd? If so, can someone suggest how the logic of how it could work?
推荐答案仅使用 .htaccess 文件,因为如果您在domain网站上的 doc_root 级。
It's not possible using just an .htaccess file as all visitors would be presented with an HTTP standard authentication dialog if you enabled it on your domain site at the doc_root level.
不知道您使用的是哪种脚本语言? (您没有在标记中指出,只是apache),但是您可以提供一个索引页面,该页面既可以充当用户/潜在用户的登录页面,也可以为MFP参与者提供登录名(用户名/密码形式)(
Without knowing what scripting language you're using? (you've not indicated in the tags, just apache), but you could provide one index page that both acts as a landing page for users/potential-users as well as provide a login (username/password form) for MFP parties (wherever they may come from).
这样,您既可以满足这两个需求,又不会冒犯或以任何方式歧视任何一方。
That way, you fulfil both needs without offending or discriminating in any way against any party.
更多推荐
除非使用.htaccess登录,否则将所有流量重定向到保留页面
发布评论