【发布时间】:2015-08-17 10:16:44
【问题描述】:
我尝试了所有可以找到的方法,包括在这个网站上。但是重定向不起作用。
My config.php
$config['base_url'] = 'http://'.$_SERVER['HTTP_HOST'];
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = '';
重写引擎开启
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)/$ /$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.**.ru$ [NC]
RewriteRule ^(.*)$ http://**.ru/$1 [R=301,L]
RewriteCond $1 !^(robots\.txt|index\.php|image\.php|favicon\.ico|upload|sotrudnik|generator|links|assets|agents|old|sitemap\.xml|4cc707e99fb15630dc\.html|sitemap_mobile\.xml|yandex_6bfb7e8daf6b3458\.html|holder\.js)
RewriteRule ^(.*)$ /index.php/$1 [L]
这个.htaccess
【问题讨论】:
-
你找到解决办法了吗?
标签: .htaccess codeigniter mod-rewrite