我的live server上URL中的Index.php
我正在为我的一个项目使用codeigniter我解决了从本地URL中删除index.php的问题,但昨天我在登台服务器上配置了代码,在登台服务器上启用了apache中的rewite mod。配置文件和.htaccess与我在本地计算机上使用的配置文件相同。但是我仍然有URl中index.php的问题 My config.php我的live server上URL中的Index.php,php,codeigniter,Php,Codeigniter,我正在为我的一个项目使用codeigniter我解决了从本地URL中删除index.php的问题,但昨天我在登台服务器上配置了代码,在登台服务器上启用了apache中的rewite mod。配置文件和.htaccess与我在本地计算机上使用的配置文件相同。但是我仍然有URl中index.php的问题 My config.php $config['base_url'] = ''; $config['index_page'] = ''; $config['uri_protocol'] = 'AUTO
$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] = '';
我的数据库文件
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'username';
$db['default']['password'] = 'password';
$db['default']['database'] = 'database';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
我的.htaccess文件
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /mediabox
RewriteCond $1 !^(index\.php|css|images|js|robots\.txt)
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
当我尝试使用上面的url打开它时,它给出了404错误
但是当我尝试使用此url打开时,它会打开
http://stage.carrier.com/index.php/home/box/12
主要原因是什么?
有什么想法吗
谢谢您使用的是Microsoft IIS/7.5服务器
.htaccess
文件用于Apache Web服务器,ASP.NET将忽略这些文件
我相信IIS本身就很好,但它可能不是PHP应用程序的最佳解决方案,我建议您在CI/PHP项目中使用常规LAMP堆栈。您确定启用了mod_rewrite吗?您使用的是共享主机吗?或者您配置了服务器本身。请注意,如果您自己配置了服务器,您是否更新了httpd.conf中的指令
AllowOverride All
。如果AllowOverride设置为None,.htaccess
将不会被apache使用
http://stage.carrier.com/index.php/home/box/12