dongyu6276 2015-09-04 03:50 采纳率: 0%
浏览 1256

在此服务器上找不到请求的URL

I have imported a codeigniter application to my server. When I am trying to browse to any other page from index page its showing my url not found error. I have changed my base url in config.php file and my .htaccess file looks like this-

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

# BEGIN Compress text files^M
<ifModule mod_deflate.c>
#  AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain^M
#  AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml^M
#  AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml^M
#  AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json^M
#  AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf^M
#  AddOutputFilterByType DEFLATE font/truetype font/opentype^M
</ifModule>
# END Compress text files^M

# BEGIN Turn ETags Off^M
#FileETag None^M
# END Turn ETags Off

Also when I am trying to access the page with this url format-

http://localhost/projectname/index.php/signin?uid=%271441336195

Its accessible.I am running apache server on linux. Any help will be highly appreciated.

  • 写回答

1条回答 默认 最新

  • douwen7475 2015-09-04 04:51
    关注

    in config.php change this

    $config['base_url'] = '';
    $config['index_page'] = '';
    

    and .htaccess should be

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

    Note: Make sure

    1. Uploaded all files(system, application,....)
    2. .htaccess place outside appllication folder
    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大