将网站更改为ssl安全后解析页面时,URL中的斜杠已删除 [英] Slash removed from URL when resolving page after changing site to ssl secure

查看:53
本文介绍了将网站更改为ssl安全后解析页面时,URL中的斜杠已删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近使我的网站ssl安全了.从那时起,我注意到,如果我将网站上某个页面的URL粘贴到浏览器的URL栏中,则当页面尝试解析时,该URL会变形并且找不到该页面.它似乎总是要做的是在域和以下目录之后删除斜杠,所以

I recently made one of my websites ssl secure. Since then I have noticed that if I paste a url of one of the pages on the website into a browser url bar, when the page tries to resolve, the url gets mangled and the page is not found. What it always appears to do is remove the slash after the domain and the following directory, so

waynecbent.com/html/somefile.html

waynecbent.com/html/somefile.html

成为:

waynecbent.comhtml/somefile.html

waynecbent.comhtml/somefile.html

起初我以为这是我的浏览器正在做的事情,但是从那时起,我发现这发生在不同平台上的不同浏览器上.

At first I thought this was something my browser was doing, but since then I have discovered this occurs on different browsers on different platforms.

我联系了我的域名提供商(Namecheap),但他们说这是主机的问题.

I contacted my domain provider (Namecheap) but they said it is a problem with the host.

我对该站点的配置如下:

My configuration for the site is as follows:

<VirtualHost *:443>
  ServerName www.waynecbent.com
  DocumentRoot /home/<redacted>/public_html
  SSLEngine on
  SSLCertificateFile "/home/<redacted>/ssl/<redacted>.crt"
  SSLCertificateKeyFile "/home/<redacted>/ssl/<redacted>.pem"
  SSLCACertificateFile "/home/<redacted>/ssl/<redacted>_bundle"
</VirtualHost>
<VirtualHost *:443>
  ServerName waynecbent.com
  DocumentRoot /home/<redacted>/public_html
  SSLEngine on
  SSLCertificateFile "/home/<redacted>/ssl/<redacted>.crt"
  SSLCertificateKeyFile "/home/<redacted>/ssl/<redacted>.pem"
  SSLCACertificateFile "/home/<redacted>/ssl/<redacted>_bundle"
</VirtualHost>

有人知道为什么会这样吗?

Does anyone know why this may be?

谢谢Allasso

推荐答案

您的域注册商应该与该问题无关.他们将请求发送到域名Waynecbent.com到您的托管人,然后由托管人处理请求.我相信根据您的http标头可以正确执行该操作.

Your domain registrar should have nothing to do with this issue. They send requests to the domain waynecbent.com to your hoster, which then handles the request. That action occurs correctly I believe based on your http headers.

几乎可以肯定,此问题是由有缺陷的mod_rewrite规则引起的,因此您必须粘贴所有htaccess或apache config重写规则来解决此问题.

This issue is almost certainly caused by a defective mod_rewrite rule, so you have to paste in all your htaccess or apache config rewrite rules to solve the issue.

如果您没有重写规则,则说明您的托管服务提供商已将ssl处理弄乱了,但这是我最后的猜测.

If you have no rewrite rules, then your hoster has messed up something with the ssl handling, that would be my last guess however.

对url的请求被重定向到302错误的URL,这意味着服务器上的某处正在进行重写,这是apunt 2.2.22的ubuntu,因此您可以看到该请求命中了您的服务器,并被重定向到不存在的网址.

A request to the url is 302 redirected to the bad url, which means there's a rewrite going on somewhere on your server, which is ubuntu with apache 2.2.22, so you can see the request hit your server, and was redirected to that non existent url.

这篇关于将网站更改为ssl安全后解析页面时,URL中的斜杠已删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆