http-redirect 相关问题

更新URL时,服务器会发送带有更新URL的HTTP重定向消息。 HTTP中的重定向选项也被服务器用于执行负载平衡。

在 laravel 10 jetstream 中,登录后它会将我重定向到仪表板,甚至通过 RouteServiceProvider.php 我写 public const HOME = 'home';

我正在尝试在登录后将用户发送到不同的页面。所以我使用 laravel jetstream 。但我不希望用户被发送到仪表板。所以在routeserviceprovider中我写了public const HOME = ...

回答 1 投票 0

Woocommerce:WP 网络站点中的支付网关自定义感谢页面

通过子主题中的以下代码,在 PayPal 中付款后,我将用户重定向到自定义感谢页面,而不是标准感谢页面。效果很好。但是...

回答 1 投票 0

WordPress 与 nginx 上游不断重定向

出现了一种情况,运行 Nginx 的 server1 会将所有 / 位置转发到 server2,同时将 /api 和其他一些位置保留在 server1 上。这也是为了让 SSL 保持正常运行。正在尝试移动...

回答 2 投票 0

如何创建代理服务器绕过IP白名单

我们有一个 apache 服务器正在服务器 A 中运行。 我们有一个Web服务正在服务器B上运行,它启用了IP白名单。因此只有服务器 A 可以使用对 Web 服务的请求。 我正在使用浏览器...

回答 1 投票 0

azure 静态 webapp 将子域重定向到内部路径

我正在使用 Azure 静态 Web 应用程序运行一个角度应用程序。有没有办法将子域重定向到内部路径。 比方说:abc.mydomain.com。到 mydomain.com/abc 我已经配置了 CNAME 我...

回答 2 投票 0

如果在函数内调用,Django 重定向将不起作用

我想将重定向命令放入函数内,然后在 Django 视图中调用该函数。谁能告诉我为什么下面的代码不重定向? 此重定向有效: 查看...

回答 1 投票 0

DNS 记录将 www 重定向到非 www

我正在使用 Namecheap 域名和 Vultr 托管。 我正在尝试将 DNS www 重定向到非 www。 www.example.com 到 example.com 我联系了 Vultr 并询问如何使用他们的 DNS 管理器执行此操作,他们...

回答 3 投票 0

为了检测所使用的浏览器语言并确保一次性重定向,我使用了 htaccess

当用户使用印尼语以外的浏览器语言时,我希望我的网站重定向到英语。我已经用 htaccess 成功实现了这一点。但是,我面临一个问题:当用户使用 En...

回答 1 投票 0

netlify 重定向在 React 应用程序中不起作用

我正处于我的程序员之旅的开始,这是我的第一篇文章,可能不是最后一篇。 所以这里有问题。我使用 create-react-app 在 React 中构建组合项目。这不是必要的技术...

回答 2 投票 0

JavaScript 触发的重定向在 facebook webview 中打开的网站上不起作用

从 Android 上的 Facebook 应用程序中打开我们的电子商务网站,会在 Facebook 网络视图中打开页面本身。执行购买时,将打开外部应用程序进行数字识别,...

回答 1 投票 0

如何在 Angular 中使用 angular-oauth2-oidc 进行身份验证后启用重定向到请求的 URL?

我目前正在开发一个 Angular 独立应用程序,其中使用 angular-oauth2-oidc 进行身份验证。我已使用授权代码流程成功配置身份验证,...

回答 1 投票 0

检查 PHP 脚本中的域和名称服务器未按预期工作

我正在使用 PHP 编写一个表单,用于检查域是否可用以及名称服务器是否正确。但是,我面临着域名和域名服务器验证的问题。 我正在使用 PHP 编写一个表单,用于检查域是否可用以及名称服务器是否正确。但是,我面临域名和名称服务器验证的问题。 <form id="domainForm"> Subdomain: <input type="text" id="subdomainInput" name="subdomain"> Domain: <select id="domainSelect" name="domain"> <option value="faucet.lol">faucet.lol</option> <option value="freecrypto.tech">freecrypto.tech</option> <option value="custom">Custom</option> </select> <input type="text" id="customDomainInput" class="hidden" name="customDomain"> <button type="button" onclick="submitForm()">Submit</button> </form> <script> var domainSelect = document.getElementById('domainSelect'); var customDomainInput = document.getElementById('customDomainInput'); domainSelect.addEventListener('change', function() { if (this.value === 'custom') { this.classList.add('hidden'); customDomainInput.classList.remove('hidden'); } else { this.classList.remove('hidden'); customDomainInput.classList.add('hidden'); } }); function submitForm() { var isCustomDomain = domainSelect.value === 'custom'; var domain = isCustomDomain ? customDomainInput.value : domainSelect.value; var subdomain = document.getElementById('subdomainInput').value; fetch('checkDomain.php', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: 'domain=' + encodeURIComponent(domain) + '&subdomain=' + encodeURIComponent(subdomain) + (isCustomDomain ? '&customDomain=' + encodeURIComponent(customDomainInput.value) : ''), }) .then(response => response.text()) .then(data => { if (data === 'OK') { var redirectUrl = isCustomDomain ? "https://faucethost.mysellix.io/product/65096ccda9171?Domain=" + encodeURIComponent(domain) + "&Subdomain=" + encodeURIComponent(subdomain) : "https://faucethost.mysellix.io/product/65096ccda9170?Domain=" + encodeURIComponent(domain) + "&Subdomain=" + encodeURIComponent(subdomain); window.location.href = redirectUrl; } else { alert(data); } }); } </script> <?php function isDomainAvailable($domain) { if (!filter_var($domain, FILTER_VALIDATE_URL)) { return false; } $curlInit = curl_init($domain); curl_setopt($curlInit, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($curlInit, CURLOPT_HEADER, true); curl_setopt($curlInit, CURLOPT_NOBODY, true); curl_setopt($curlInit, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curlInit); curl_close($curlInit); if ($response) return true; return false; } function is_valid_domain_name($domain_name) { return (preg_match("/^([a-zd](-*[a-zd])*)(.([a-zd](-*[a-zd])*))*$/i", $domain_name) //valid characters check && preg_match("/^.{1,253}$/", $domain_name) //overall length check && preg_match("/^[^.]{1,63}(.[^.]{1,63})*$/", $domain_name) ); //length of every label } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $subdomain = $_POST['subdomain']; $domain = $_POST['domain']; if ($domain === 'custom') { $domain = $_POST['customDomain']; } if (!is_valid_domain_name($domain)) { echo "Error: Invalid domain name."; return; } if (isDomainAvailable('https://' . $subdomain . '.' . $domain)) { echo "Error: Subdomain already exists."; return; } if ($domain === 'custom') { $dnsRecords = dns_get_record($domain, DNS_NS); $correctNameservers = ['ns11.webshineglobal.xyz', 'ns12.webshineglobal.xyz']; $hasCorrectNameservers = false; foreach ($dnsRecords as $record) { if (in_array($record['target'], $correctNameservers)) { $hasCorrectNameservers = true; break; } } if (!$hasCorrectNameservers) { echo "Error: Please set your nameservers to ns11.webshineglobal.xyz and ns12.webshineglobal.xyz."; return; } } echo "OK"; return; } ?> 我面临的问题是,当选择自定义域时,它总是重定向用户并认为名称服务器是正确的。它认为名称服务器不正确的唯一情况是我在域字段中输入“自定义”一词。 我尝试添加域验证函数并打印 $dnsRecords 数组以查看 dns_get_record() 返回的内容,但我仍然无法确定问题出在哪里。 如果您能提供有关如何解决和纠正此问题的指导,我将不胜感激。预先感谢。 您的代码仅在出现“自定义”一词时才有效,因为您添加了这样做的条件! $domain = $_POST['domain']; if ($domain === 'custom') { $domain = $_POST['customDomain']; } if ($domain === 'custom') { $dnsRecords = dns_get_record($domain, DNS_NS); // rest of the code } 鉴于此,当用户选择自定义域时,您期望收到字符串 'custom'。 您可以删除条件或将“自定义”一词添加到获取的正文中'domain=custom_' + encodeURIComponent(domain)每个域,代码将按预期工作

回答 1 投票 0

uvicorn [fastapi] python 运行 HTTP 和 HTTPS

我正在尝试使用 SSL 运行 fastapi 应用程序。 我正在使用 uvicorn 运行该应用程序。 我可以使用 HTTP 在端口 80 上运行服务器, 如果 __name__ == '__main__': uvicorn.run("main:app", port=80, hos...

回答 3 投票 0

在 docker 容器中重定向输出 http&https 请求的解决方案

我正在尝试在 docker 容器中构建一些 OSS。然而构建脚本尝试从 Github 下载一些文件。不幸的是,我无法在我的 docker 容器中访问互联网——我只能......

回答 1 投票 0

重定向到HTTPS,同时保留指定的端口号

我使用 IIS 10.0.17763 并配置 HSTS 将 HTTP 重定向到 HTTPS。从端口 80 到 443 工作正常,但如果指定不同的端口,它仍然会重定向到 443 而不是原始端口...

回答 1 投票 0

将所有流量从路由器重定向到代理服务器

我不知道这个问题是否与 stackoverflow 上的主题相关,所以,如果没有提前抱歉。 我有以下问题正在尝试解决: 我已连接到我的大学网络...

回答 1 投票 0

我无法使其重定向。计时器可以工作,但去不了任何地方。我需要这个来重定向到另一个网页

函数startTimer(持续时间,显示){ var 计时器 = 持续时间、分钟、秒; var end =setInterval(函数 () { 分钟 = parseInt(计时器 / 60, 10) 秒 = </desc> <question vote="0"> <pre><code>&lt;script&gt; function startTimer(duration, display) { var timer = duration, minutes, seconds; var end =setInterval(function () { minutes = parseInt(timer / 60, 10) seconds = parseInt(timer % 60, 10); minutes = minutes &lt; 10 ? &#34;0&#34; + minutes : minutes; seconds = seconds &lt; 10 ? &#34;0&#34; + seconds : seconds; display.textContent = minutes + &#34;:&#34; + seconds; if (--timer &lt; 0) { //window.location = &#34;http://www.YouTube.com&#34;; clearInterval(end); } }, 1000);} window.onload = function () { var fiveMinutes = 5, display = document.querySelector(&#39;#time&#39;); startTimer(fiveMinutes, display); }; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt;Redirect in &lt;span id=&#34;time&#34;&gt;05:00&lt;/span&gt;&lt;/div&gt; &lt;form id=&#34;form1&#34; runat=&#34;server&#34;&gt; &lt;/form&gt; </code></pre> <p>我无法让它真正重定向。倒计时有效,但不重定向。我刚拿到计时器。计时器倒计时并归零,完全没有任何进展。</p> </question> <answer tick="false" vote="0"> <p>首先,--timer 将始终返回 4,因为初始值设置为 5,因此您永远不会被重定向。您应该添加一个 else 块,以在每 60 000 毫秒后将计时器值减少 1。</p> </answer> </body></html>

回答 0 投票 0

Google Chrome 123 更新:Chrome 正在对文档/重定向类型 GET 请求进行预检检查

chrome 新更新后,我的应用程序中遇到了 CORS 异常。经过调查,我发现它正在对文档/重定向类型 GET 请求进行 CORS 预检检查,它...

回答 1 投票 0

重定向:fetch 中的“手动”重定向到请求 URL,而不是重定向到响应中的标头位置

我有以下代码,用于获取响应标头位置。 让 callAuthorize = async() => { 尝试 { const AuthorizeResponse = 等待 fetch(requesturl, {重定向:“

回答 1 投票 0

Apache2 HTTPS 重写虚拟主机中的重定向过多

我的一个虚拟主机上不断收到太多重定向,但另一个虚拟主机上却没有。我确信我犯了一些我只是不认识的非常小的错误。我已在下面附加了两个 Apache2 站点配置...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.