除非使用.htaccess登录,否则将所有流量重定向到保留页面

编程入门 行业动态 更新时间:2024-10-26 00:19:19
本文介绍了除非使用.htaccess登录,否则将所有流量重定向到保留页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我目前在我的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登录,否则将所有流量重定向到保留页面

本文发布于:2023-11-02 08:33:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551907.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:则将   重定向   流量   页面   htaccess

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!