簡體   English   中英

HybridAuth“Tiny Social Hub”示例重定向到 /hybridauth/?hauth.start=Facebook&hauth.time

[英]HybridAuth "Tiny Social Hub" example redirecting to /hybridauth/?hauth.start=Facebook&hauth.time

我試圖弄清楚 HybridAuth 是如何工作的。 我已經按照說明將它安裝在我的服務器上,添加了我的 Facebook、Google 等開發人員密鑰,但是當我轉到“Tiny Social Hub”示例時:

www.mysite.org/inc/examples/social_hub/login.php

然后單擊“使用 Facebook 登錄”,我被重定向到:

www.mysite.org/inc/hybridauth/?hauth.start=Facebook&hauth.time=1362314218

與“使用 Google 登錄”類似:

www.mysite.org/inc/hybridauth/?hauth.start=Google&hauth.time=1362314279

我只看到/inc/hybridauth/的直接列表,其中包括:

index.php
config.php
Hybrid/

我錯過了什么?

我能夠解決這個問題。 對於可能遇到此問題的任何人,修復是基於對Hybrid auth with Yii 導致重定向循環問題的回應,特別是以下幾點:

您在配置文件“hybridauth.php”中的 base_url 應設置為“/hauth/endpoint”,即它必須指向端點。 如果您通過 .htaccess 刪除了 index.php,則使用“/index.php/hauth/endpoint”。

我需要調整我的基本網址:

"base_url" => "http://mysite.org/inc/hybridauth/"

到:

"base_url" => "http://mysite.org/inc/hybridauth/index.php"

我的猜測是第一個 url 在大多數情況下都可以工作,因為 index.php 通常是默認目錄頁面。 而我已將 Apache 配置為在我的服務器上使用 home.php。

假設您使用的是 Apache,另一種解決方案是讓您告訴它將 index.php 識別為索引文件。

在相關的 /etc/(httpd|apache2)/sites.enabled/ 或 httpd.conf 文件中添加以下內容

目錄索引 index.php

或者,假設 apache 被配置為允許 .htaccess 文件,只需創建一個 .htaccess 文件並將上面的行放在那里。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM