使用 https/ssl 进行 Kohana 路由

发布于 2024-12-08 12:16:10 字数 1029 浏览 1 评论 0原文

我正在开发 Facebook 应用程序,刚刚设置了 SSL 证书,但这导致路由停止工作。

http://domain.com/tab <- 可以工作,但使用 https 会导致失败

https://domain.com/index.php/tab <- 有效

这是目前我在.htaccess 文件。

# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

# Protect application and system files from being viewed
RewriteRule ^(application|modules|system) - [F,L]

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]

希望有人能够阐明我的问题。

编辑

是的,抱歉,我没有真正放下大量信息。当我尝试访问该链接时,我收到 404“在此服务器上找不到请求的 URL /tab”。现在客户端告诉我服务器已经正确设置并且apache有AllowOverride。

人们还需要哪些其他信息来解决这个问题?

谢谢

编辑

这个问题已经解决。服务器管理员给我发电子邮件说“看起来该站点的 443 实例没有正确获取 htaccess 文件,因此我进行了更改并重新加载了 Apache。”他们犯了一个简单的错误。

I am working on a facebook application and have just set up the SSL certificate but this has caused the routing to stop working.

http://domain.com/tab <- Works but using https causes it to fail

https://domain.com/index.php/tab <- Works

This is currently the code im using in the htaccess file.

# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

# Protect application and system files from being viewed
RewriteRule ^(application|modules|system) - [F,L]

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]

Hopefully someone will be able to shed some light on my problem.

EDIT

Yeah sorry i havnt really put a great deal of information down. When i try going to that link i get returned a 404 "The requested URL /tab was not found on this server". Now i have been told by the client that the server has been set up correctly and apache has AllowOverride.

What other information would someone need to work this out?

Thanks

EDIT

This issue has been solved. The server admins emailed me saying "It looks as though the 443 instance of the site was not picking up the htaccess files properly so I've made a change and reloaded Apache." Simple mistake on their end.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

想你的星星会说话 2024-12-15 12:16:10

如果您刚刚收到 404,我怀疑 apache 没有像 http 那样设置 https 服务。检查您的虚拟主机指令并确保它们相对匹配。

If you are just getting a 404, I'd suspect that apache isn't setup for https serving in the same way as http. Check your virtual host directives and make sure they relatively match each other.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文