使用php codeigniter和filezilla在实时服务器上重定向错误

时间:2017-04-10 11:25:04

标签: .htaccess codeigniter mod-rewrite

我们正在使用php codeigniter框架,当我们在Localhost上运行项目时,它没有任何问题,但是当我们将它放在服务器上时,某些按钮无法正常工作。 当用户按下登录按钮时,页面将重定向到主页,而不是重定向到用户配置文件页面。

/*Htaccess File*/
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^jp_sys.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_URI} ^jp_app.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule> 
Options -Indexes

1 个答案:

答案 0 :(得分:0)

在.htaccess中试用此代码对我有用........

 <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
    </IfModule>