2
我不知道如何去做這件事,但我希望我的用戶使用m.site_url.com
作爲網站的移動版本。我有一個CMS,我的主站點的移動版本在CMS文件夾之外。一旦用戶打開這個URL,他們會被要求登錄。登錄後有形式的以下重定向提交if/else不在子域上工作
<input type="hidden" name="mobileVersion" value="True">
<input type="hidden" name="redir" value="../mobile/crew_center.php" />
<input type="hidden" name="action" value="login" />
<input class="login-btn" type="submit" name="submit" value="Log In" />
/mobile
是在URL中m
目錄的文件夾。當用戶打開m.site_url.com
(site_url.com作爲示例)時,以下if/else運行在此URL的index.php中。
<?php include_once'/home/flyeurov/public_html/core/codon.config.php'; // This includes functions of a CMS for instance Auth::LoggedIn
if(Auth::LoggedIn())
{
header("Location: crew_center.php");
}
else
{
header("Location: login.php");
}
?>
上面的代碼,當用戶登錄,進入site_url.com/mobile
將打開crew_center.php頁面工程的直接路徑,例如。但是,當用戶鍵入m.site_url.com
時,無論用戶是否登錄,它都將始終顯示login.php。
我怎樣才能得到這個聲明在m.site_url.com
子域的工作?
什麼是你codon.config.php的代碼? – SaidbakR
http://pastebin.com/BWcbddGG – user2442178
你確定Auth Class不依賴於網站的URL嗎?我認爲這是一個Cookie的問題,子域被視爲不同的網站!在與子域登錄後是否像往常一樣用主域重新綁定用戶? – SaidbakR