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条)

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题