San*_*iya 5 php .htaccess codeigniter
我的codeigniter完全在本地主机上工作,但不能在live.my codeigniter工作是最新版本.我也尝试old.it总是显示我在重定向上找不到页面.
routes.php设置是
$route['default_controller'] = "home";
$route['404_override'] = '';
Run Code Online (Sandbox Code Playgroud)
我也在server.i上传htaccess在linux和window中都尝试过.
htaccess的
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
Run Code Online (Sandbox Code Playgroud)
你可以做:
$config['base_url'] = 'http://'.$_SERVER['HTTP_HOST']; //you can also leave blank this CI tend to find this by himself
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO'; //if not working try one of these:
'PATH_INFO' Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI' Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
Run Code Online (Sandbox Code Playgroud)
并尝试这个.htaccess我在很多网站上使用的
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
Run Code Online (Sandbox Code Playgroud)
如果还没有工作,请使用 aphpinfo();并检查 mod_rewrite 是否为enabled
| 归档时间: |
|
| 查看次数: |
10310 次 |
| 最近记录: |