donglian2106 2014-02-14 11:35
浏览 43
已采纳

htaccess没有重定向到codeigniter

i am new in php & codeigniter.i am working on a project which was running in a server abcd.comand i am using htaccess code like this

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

now my project has been moved to another server 192.000.000.000.i can access the login page, when the user is logged in session is getting set and it is redirecting to 192.000.000.000/myproject/user and here i am getting 404 error

i have been set base_url in config.php is like this

$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
$config['base_url'] .= "://".$_SERVER['HTTP_HOST'];
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']); 

$config['index_page'] = '';

my WINSCP Project structure

old one :  /home/my_org/public_html/prjFolder
new one :  /var/www/html/prjFolder

my .htaccess file like this

system/
application/
user_guide/
index.php
.htaccess

if anyone find solution please help me..

  • 写回答

3条回答 默认 最新

  • douchuo1963 2014-02-20 10:11
    关注

    I find the solution , It is the problem of apache rewrite_module. I changed my httpd.conf file and now its working perfect.

    Change AllowOverride None to AllowOverride All

    <Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    

    and Restart the Apache daemon using putty # service httpd restart

    Reference Url : - http://dev.antoinesolutions.com/apache-server/mod_rewrite

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?