gpt4 book ai didi

php - Codeigniter - 设置 SSL 并收到 404 错误

转载 作者:太空宇宙 更新时间:2023-11-03 12:59:14 25 4
gpt4 key购买 nike

我已经使用 this tutorial 设置了一个测试 SSL 证书.我的应用程序需要用户身份验证。正如预期的那样,我在加载登录页面时收到一条错误消息。当我尝试导航到任何其他页面或提交登录表单时,我收到 404 错误消息。

我的假设是所有 URL,因为它们是由 Controller 创建的,所以不再在 .htaccess 中重写。我不清楚如何解决此问题,以便除基础 index.php 文件之外,我的所有 URL 都能正常工作。

我的服务器详细信息如下:

  • Apache2
  • Ubuntu 12.04
  • Codeigniter 2(2 的某个版本)

这是我的.htaccess 文件:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php
</IfModule>

最佳答案

您需要在您的 apache 配置中设置 AllowOverride 指令。

将 AllowOverride None 更改为 AllowOverride All

Set Allow Override

关于php - Codeigniter - 设置 SSL 并收到 404 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27723284/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com