我有這個登錄功能:笨重定向不起作用
public function members() {
if($this->session->userdata('is_logged_in')){
redirect('pag/index.php');
}else{
redirect('main/restricted');
}
這將讓我一個404,如果我更迭登錄! 但是,如果我會嘗試這樣的:
public function members() {
if($this->session->userdata('is_logged_in')){
$this->load->view('pag/index.php');
}else{
redirect('main/restricted');
}
隨着$this->load->view
它會工作,也是redirect('main/restricted')
工作。我有redirect('pag/index.php');
問題回到我404
THID是我.htaccess
如何尋找:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /delta-rom/
#CI_FOLDER is the Location of your CI files.
#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]
#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>
我用笨3V。 Ty非常適合你的時間。
解決,謝謝,是衝突的另一個功能! – Bogdan
PHP不是JavaScript。換句話說,您不能將代碼片段功能用於PHP代碼,這應該通過代碼窗格上的「JavaScript」標籤顯而易見。 – Sparky