简体   繁体   中英

Codeigniter default controller issue on Godaddy linux hosting

I'm using Godaddy linux hosting and I've deployed codeigniter source code on it. It is working absolutely fine on localhost. My default controller name is 'Welcome'.

  1. When i try to login by pressing login button after entering username and password, without writing default controller name in the url then it says "The action you have requested is not allowed." in some locations it works fine. Here is how i write url ' https://www.example.com '

  2. When i write default controller name in the url, then enter username and password and then press login button. it works fine. Here is how i write https://www.example.com/Welcome

  3. When i remove 'www' from base_url in config file, it works fine on some locations but don't work in some other locations. Here is my config file

     $config['base_url'] = 'https://www.example.com/'; $config['index_page'] = ''; $config['uri_protocol'] = 'REQUEST_URI'; $config['url_suffix'] = ''; $config['language'] = 'english'; $config['charset'] = 'UTF-8'; $config['enable_hooks'] = FALSE; $config['subclass_prefix'] = 'MY_'; $config['composer_autoload'] = FALSE; $config['permitted_uri_chars'] = 'az 0-9~%.:_\\-@'; $config['enable_query_strings'] = FALSE; $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm'; $config['directory_trigger'] = 'd'; $config['allow_get_array'] = TRUE; $config['log_threshold'] = 0; $config['log_path'] = ''; $config['log_file_extension'] = ''; $config['log_file_permissions'] = 0644; $config['log_date_format'] = 'Ymd H:i:s'; $config['error_views_path'] = ''; $config['cache_path'] = ''; $config['cache_query_string'] = FALSE; $config['encryption_key'] = ''; $config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = NULL; $config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = FALSE; $config['cookie_prefix'] = ''; $config['cookie_domain'] = ''; $config['cookie_path'] = '/'; $config['cookie_secure'] = FALSE; $config['cookie_httponly'] = FALSE; $config['standardize_newlines'] = FALSE; $config['global_xss_filtering'] = FALSE; $config['csrf_protection'] = True; $config['csrf_token_name'] = 'csrf_snt_token'; $config['csrf_cookie_name'] = 'csrf_cookie_snt'; $config['csrf_expire'] = 7200; $config['csrf_regenerate'] = TRUE; $config['csrf_exclude_uris'] = array(); $config['compress_output'] = FALSE; $config['time_reference'] = 'local'; $config['rewrite_short_tags'] = FALSE; $config['proxy_ips'] = ''; 

I don't know where is am doing wrong. I want that it should work without even writing default controller name in the url. Any help would be much appreciated :)

使用CI_Docs URL中提供的htaccess代码

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM