我已将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服务器。任何帮助将受到高度赞赏。
答案 0 :(得分:0)
更改此
config.php
和$config['base_url'] = '';
$config['index_page'] = '';
应为
.htaccess
注意:确保
- 上传所有文件(系统,应用程序,......)
- 醇>
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule>
位于appllication文件夹外