将版本更改为2.1.1后,.htaccess文件无法在codeigniter中工作

时间:2013-01-16 12:12:46

标签: .htaccess codeigniter version

我想从

重定向URl

http://www.mydomain.com/b2b/testarab

http://www.mydomain.com/b2b/index.php/business/show/testarab

我也设置了

$config['index_page'] = '';

我的.htaccess文件是

RewriteEngine on
php_value max_file_uploads 30
RewriteBase /b2b
RewriteCond %{REQUEST_URI} \s
RewriteRule  ^(home.*|buyers.*|sellers.*|companies.*|mall.*|category.*|product_details.*|contact_now.*|join.*|login.*|myprofile.*|dashboard.*|buy_sell_items.*|trade.*|media.*|myadvertise.*|mycontacts.*|myemail.*|myhotel.*|mymedia.*|payment.*|tradeshows.*|tradeshow_details.*|search_tradeshows.*|business.*)$ index.php/$1 [NC,L,QSA]
RewriteRule ^([a-zA-Z0-9._-\s]+)$ index.php/business/show/$1 [NC,L,QSA]

在这个文件中,第一个RewriteRule正在运行.. 第二个不起作用..

1 个答案:

答案 0 :(得分:0)

.htaccess

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

将变量设置为空,如下所示。

$config['index_page'] = '';

尝试逐个替换以下变量('AUTO','PATH_INFO','QUERY_STRING','REQUEST_URI'和'ORIG_PATH_INFO')

$config['uri_protocol'] = 'AUTO';