dougongnan2167 2016-03-04 09:56
浏览 136

强制HTTP到HTTPS导致404错误

I have a website based on WordPress, and one section of it is built by external programmers (the backend). I was able to force all connections to go on HTTPS instead of HTTP using a plugin for the WordPress part, but for this specific area which isn't WordPress-based I had to do something else. My knowledge is restricted so I just googled it and found I should create an .htaccess file inside the specific folder with the following:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteCond %{REQUEST_URI} folder 
RewriteRule ^(.*)$ https://www.yourdomain.com/folder/$1 [R,L]

I did just that, and now when I'm trying to access that area, it says it doesn't exist (404 error):

The requested URL /backend/auth/login was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

The weird thing is, when I try to access directly the link The requested URL /backend/index.php, it does work and redirects me to:

/backend/index.php/auth/login

I don't know how to fix it or what to do but actually I don't see an "auth" folder in there, but it works under index.php

In addition, when trying to reverse what I did, I deleted the .htaccess file, but it still isn't working, which is really weird.

Any ideas?... Thanks!

  • 写回答

1条回答 默认 最新

  • dongpu6141 2016-03-04 10:35
    关注

    You can not delete the .htaccess file because it is used by wordpress for all HTTP and HTTPS redirects.

    This error does not seem to be by HTTPS. It seems that Wordpress url does not exist or can not translate it. Try these things:

    1. Recover the original .htaccess and retests the URL
    2. Modify the URL in the database. Remember that Wordpress keep them there.
    评论

报告相同问题?

悬赏问题

  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来