OK, zrobiłem dokładnie tak, jak zapytałem w dokumentacji CodeIgniter, utworzony nowy plik .htaccessCodeIgniter | .htaccess usunięcie index.php z adresu URL
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
Używam xampp, więc mój URL dostępu do witryny był
http://localhost:12/projects/zorkif_nextgen/index.php/main
teraz po zastosowaniu powyższego pliku .htaccess, próbowałem go bez index.php jak ten
http://localhost:12/projects/zorkif_nextgen/main
ale zamiast pracować, to R kieruje mnie do tego adresu:
http://localhost:12/xampp
Jak rozwiązać ten problem?
plus i otrzymuję błąd na mojej stronie po wypróbowaniu .htaccess
na górze strony pojawia się komunikat,
Error Occured.
Warning!. Make sure you perform the correct action.
The Action has been completed Successfully.
Edit:
Oto mój Ustawienia pliku config.php:
$config['base_url'] = '';
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] = '';
$config['enable_hooks'] = FALSE;
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use
$config['sess_cookie_name'] = 'zk_ci_session';
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = TRUE;
$config['sess_encrypt_cookie'] = TRUE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'sys_ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['rewrite_short_tags'] = FALSE;
dokładne i kompletne odpowiedź http://stackoverflow.com/questions/14297770/cannot-remove-index-php-from-codeigniter-url – Sami
zamiast 'RewriteRule^(. *) $ /index.php/$ 1 [L] 'użyj' RewriteRule^(. *) $ Index.php/$ 1 [L] 'w twoim folderze głównym /.htaccess –