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

时间:2015-09-04 03:50:54

标签: php .htaccess codeigniter

我已将codeigniter应用程序导入我的服务器。当我尝试从索引页面浏览到任何其他页面时,它显示我的网址未找到错误。我在config.php文件中更改了我的基本URL,我的.htaccess文件看起来像这样 -

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

当我尝试使用此网址格式访问网页时

  

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

它可访问。我在linux上运行apache服务器。任何帮助将受到高度赞赏。

1 个答案:

答案 0 :(得分:0)

<{1>}中的

更改此

config.php

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

.htaccess
  

注意:确保

     
      
  1. 上传所有文件(系统,应用程序,......)
  2.   
  3. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> 位于appllication文件夹外
  4.