0
我在Heroku上遇到CodeIgniter重定向問題。下面是URL:CodeIgniter在Heroku上重定向
http://sergei-game.herokuapp.com/
特別是,正在發生的事情是,重定向(/控制器/功能)被附加到URL,而不是替換/控制器/功能中的URL。
當我導航到本地主機上的相同URL時,我沒有這些問題。
這裏是主控制器相關代碼:
public function index() {
redirect('gameplayer/login', 'refresh');
}
public function login() {
if (isset($_SESSION['email'])) {
// if logged in, go to character selection page
redirect('gameplayer/viewAccount');
} else {
$this->load->view('auth/login');
}
}
這裏是我的.htaccess文件
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
我接過一看Heroku的日誌,但他們並不十分令對我來說很有意義。
這解決了這個問題。爲什麼CodeIgniter在傳遞''時不會推斷base_url? – BlackSheep