网页作为HTTPS力集(Force subset of webpages as HTTPS)

   IT问题网   2018-01-27 00:00:00

问 题

我想迫使网页,https和所有其他网页的http的一个子集。 在htaccess的我用下面的脚本,我发现在另一篇文章,但没有工作......

 的rewritecond%{} https关闭
重写规则^(登录|注册)\ php中的https://%{http_host}%{request_uri} [r,l,qsa]

的rewritecond%{} https上
的rewritecond $ {request_uri}!(登录|注册)。\ php
(。*)重写规则的http:// {%http_host}%{request_uri} [r,l,qsa]
 

http被迫理所应当的,https是被迫所应当的,但如 https://mywebsite.com/注册产生在浏览器中一个无限循环的错误。任何想法是什么出了问题?

我改成code到这似乎工作下,但现在的ssl只部分实现,由于安全和网页不安全的项目。我检查了网址,例如图片,样式表和外部javascript文件位,这些都是相对的,不应该是一个问题......如果有人知道如何处理这一点,我会很高兴听到这个消息。

 的rewritecond%{} https关闭
的rewritecond%{request_uri} ^ /登录$ [or]
的rewritecond%{request_uri} ^ /注册$
重写规则https(*)://%{http_host}%{request_uri} [r,l]

的rewritecond%{} https上
的rewritecond%{request_uri}!登录$
的rewritecond%{request_uri}!注册$
(。*)重写规则的http:// {%http_host}%{request_uri} [r,l]
 
解决方案
  1. 尝试在你的.htaccess基础上增加这一行的地方:

    选项+了followsymlinks -multiviews

  2. 也许你有一些其他的规则,这样做重定向 - 如果你提供你的.htaccess文件的全部内容将是不错的

  3. 您可能需要重定向实际的php脚本中。

在任何acse- 如果你可以修改apache的配置文件(httpd.conf文件或的httpd-vhost.conf),那么您可以启用重写调试( rewriteloglevel 9 ),看看究竟是怎么回事 -这是最好的选择(如果可以的话)

标签:网页作为



分享:

  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


热门推荐

301重定向htaccess的(301 Redirect htaccess)

problem im having a problem with my htaccess i have the ...

多重矛盾的htaccess的规则集(Multiple conflicting htaccess RewriteRules)

problem i'm trying to have both people's profiles at exam ...

转换相对URL请求使用mod_rewrite绝对URL请求(Converting relative URL requests to absolute URL request using mod_rewrite)

problem i have made use of a simple rewrite rule in my .h ...

如何提取的404错误在PHP中的URL参数(How to extract URL parameters on 404 Error in PHP)

problem i have my htaccess redirecting to a error404.php ...

使用mod_rewrite工作不更改显示的URL结构(Change Displayed URL Structure using mod_rewrite NOT Working)

problem i need to change the structure of the displayed c ...

有条件的.htaccess(Conditional .htaccess)

problem i'm sure there are other threads on similar topic ...

重定向的站点根目录使用的.htaccess子目录(Redirecting root of site to subdirectory using .htaccess)

problem a site of mine has all the files stored in a subd ...

的.htaccess URL重写 - 删除的.php去除WWW。转换?ID = 10/10(.htaccess url rewrite - remove .php remove www. convert id=10 to /10)

problem as the title says, i need a quite com ...

从Symfony的1.4路径删除“网络”共享托管?(Remove 'web' from Symfony 1.4 path on shared hosting)

problem i've found a lot of helpful information about ins ...

小问题.htaccess文件?(small problem with .htaccess file)

problem i have a small .htaccess file which allow me to r ...

的.htaccess基于查询字符串重定向和删除查询字符串(.htaccess redirect based on query string and remove query string)

problem i'm in need to have redirect instruct ...

htaccess的导致服务器错误500(htaccess causing server error 500)

problem i have a zend framework application w ...

404 htaccess的重定向不工作(404 htaccess redirect is not working)

problem i am running tomcat on apache we server. i am put ...

通过重定向某些变量的任何页面(Redirect any page passing certain variables)

problem i'm putting a search engine on my site, and the s ...

与RewriteMap指令的MapType DBD问题(Problems with RewriteMap MapType dbd)

problem continuing from another discussion he ...

重写URL时,一个表单提交(rewrite url when a form is submitted)

problem question regarding redirection using htaccess. on ...

从URL preventing直接访问(Preventing direct access from url)

problem in one of my work i need to build a feature for u ...

的.htaccess不会影响到其他文件夹(.htaccess not affecting other folders)

problem i have a .htaccess file that affects my subdomain ...

mod_rewrite的错误:[客户127.0.0.1]文件不存在(mod_rewrite error: [client 127.0.0.1] File does not exist)

problem i want to start using mod_rewrite so i can use fr ...

重写全球htpasswd的密码保护(Overriding global htpasswd password protection)

problem i am testing a drupal site on a development serve ...