codeigniter not work at live page not found error on server

前端 未结 1 1573
太阳男子
太阳男子 2021-01-13 06:24

my codeigniter work perfectly on local host but not work at live.my codeigniter is latest version.i also try older.it always show me page not found on redirect.

rout

相关标签:
1条回答
  • 2021-01-13 07:00

    you can do:

    $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
    

    and try this .htaccess i use for many sites

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

    if not working yet, use a phpinfo(); and check if mod_rewrite is enabled

    0 讨论(0)
提交回复
热议问题