mod_rewrite |
Hola buenas noches!
Tengo el siguiente problema, no me está sirviendo el próximo archivo .htaccess, cada vez que quieri ingresar a la ruta: http://localhost/Myfolder/login?redirect=examples me sale un error 404 pero cuando escribo http://localhost/Myfolder/index.php/logi...t=examples funciona perfectamente alquien tiene alguna ayuda por favor! # ASEGÚRESE DE DEJAR LA LISTA DE NEGACIÓN EN LA PARTE SUPERIOR DEL ARCHIVO. # BEGIN DENY LIST - # END DENY LIST - <IfModule mod_rewrite.c> RewriteEngine en ¡RewriteCond $ 1! ^ (Índice \ .php | recursos | vendedor | robots \ .txt) RewriteCond% {REQUEST_FILENAME}! -F RewriteCond% {REQUEST_FILENAME}! -re RewriteRule ^ (. *) $ Index.php / $ 1 [L, QSA] </ IfModule> y el archivo index.php principal tiene la siguiente configuracion <? php define ( 'ENTORNO' , isset ($ _ SERVER) [ 'CI_ENV' ])? $ _SERVER [ 'CI_ENV' ]: 'desarrollo' ); switch (ENTORNO) { caso 'desarrollo' : error_reporting (- 1 ); ini_set ( 'display_errors' , 1 ); romper ; caso 'prueba' : caso 'producción' : ini_set ('display_errors' , 0 ); if (version_compare (PHP_VERSION, '5.3' , '> =' )) { error_reporting (E_ALL & ~ E_NOTICE & ~ E_DEPRECATED & ~ E_STRICT & ~ E_USER_NOTICE & ~ E_USER_DEPRECATED); } else { error_reporting (E_ALL & ~ E_NOTICE & ~ E_STRICT & ~ E_USER_NOTICE); } romper ; predeterminado : encabezado ( 'HTTP / 1.1 503 Service Unavailable.' , TRUE , 503 ); echo 'El entorno de la aplicación no está configurado correctamente.' ; salida( 1 ); // EXIT_ERROR } $ system_path = 'proveedor / bcit-ci / codeigniter / sistema' ; $ application_folder = 'codeigniter / application' ; $ view_folder = '' ; // Establece el directorio actual correctamente para solicitudes CLI if (defined ( 'STDIN' )) { chdir (dirname ( __FILE__ ) ); } if (($ _temp = realpath ($ system_path))! == FALSE ) { $ system_path = $ _temp.DIRECTORY_SEPARATOR; } else { // Asegúrese de que haya una barra inclinada $ system_path = strtr ( rtrim ($ system_path, '/ \\' ), '/ \\' , DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR ) .DIRECTORY_SEPARATOR; } // ¿La ruta del sistema es correcta? if (! is_dir ($ system_path)) { header ( 'HTTP / 1.1 503 Service Unavailable.' , TRUE , 503 ); echo 'La ruta de la carpeta del sistema no parece estar configurada correctamente. Abra el siguiente archivo y corríjalo : ' .pathinfo ( __FILE__ , PATHINFO_BASENAME); salida ( 3 ); // EXIT_CONFIG } / * * ------------------------------------------- ------------------------ * Ahora que conocemos la ruta, establezca las constantes de la ruta principal * ------------------------------------ ------------------------------- * / // El nombre de ESTE archivo define ( 'SELF' , pathinfo ( __FILE__ , PATHINFO_BASENAME)); // La ruta al directorio del sistema define ( 'BASEPATH' , $ system_path); // La ruta al directorio del controlador frontal (este archivo) define ( 'FCPATH' , dirname ( __FILE__ ) .DIRECTORY_SEPARATOR); // Nombre del directorio "system" define ( 'SYSDIR' , basename (BASEPATH)); // La ruta al directorio "aplicación" si(is_dir ($ application_folder)) { if (($ _temp = realpath ($ application_folder))! == FALSE ) { $ application_folder = $ _temp; } else { $ application_folder = strtr ( rtrim ($ application_folder, '/ \\' ), '/ \\' , DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR ); } } elseif (is_dir (BASEPATH. $ application_folder.DIRECTORY_SEPARATOR)) { $ application_folder = BASEPATH.strtr ( trim ($ application_folder, '/ \\'), '/ \\' , DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR ); } else { header ( 'HTTP / 1.1 503 Service Unavailable.' , TRUE , 503 ); echo 'La ruta de la carpeta de la aplicación no parece estar configurada correctamente. Abra el siguiente archivo y corríjalo: ' . SELF ; salida ( 3 ); // EXIT_CONFIG } define ( 'APPPATH' , $ application_folder.DIRECTORY_SEPARATOR); // La ruta al directorio "vistas" if (! Isset ($ view_folder [0 ]) && is_dir (APPPATH. ' Views ' .DIRECTORY_SEPARATOR)) { $ view_folder = APPPATH. 'vistas' ; } elseif (is_dir ($ view_folder)) { if (($ _temp = realpath ($ view_folder))! == FALSE ) { $ view_folder = $ _temp; } else { $ view_folder = strtr ( rtrim ($ view_folder, '/ \\' ), '/ \\' , DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR ); } } elseif(is_dir (APPPATH. $ view_folder.DIRECTORY_SEPARATOR)) { $ view_folder = APPPATH.strtr ( trim ($ view_folder, '/ \\' ), '/ \\' , DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR ); } else { header ( 'HTTP / 1.1 503 Service Unavailable.' , TRUE , 503 ); echo 'La ruta de la carpeta de vista no parece estar configurada correctamente. Abra el siguiente archivo y corríjalo: ' . SELF ; salida ( 3 ); // EXIT_CONFIG } define ('VIEWPATH' , $ view_folder.DIRECTORY_SEPARATOR); require_once BASEPATH. 'core / CodeIgniter.php' ; y mi archivo config tiene la siguiente configuracion <? php defined ( 'BASEPATH' ) O exit ( 'No se permite el acceso directo al script' ); $ config [ 'base_url' ] = "http: // localhost / MyFolder /" ; $ config [ 'index_page' ] = '' ; $ config [ 'uri_protocol' ] = 'REQUEST_URI' ; 'url_suffix' ] = '' ; $ config [ 'language' ] = 'inglés' ; $ config [ 'charset' ] = 'UTF-8' ; $ config ['enable_hooks' ] = TRUE ; $ config [ 'subclass_prefix' ] = 'MY_' ; $ config [ 'composer_autoload' ] = FALSE ; $ config [ ' allowed_uri_chars ' ] = ' az 0-9 ~%.: _ \ - ' ; $ config [ 'enable_query_strings'] = FALSO ; $ config [ 'controller_trigger' ] = 'c' ; $ config [ 'function_trigger' ] = 'm' ; $ config [ 'directory_trigger' ] = 'd' ; $ config [ 'allow_get_array' ] = TRUE ; $ config [ 'log_threshold' ] = 2 ; $ 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' ] = '1234567890' ; / $ config [ 'sess_driver' ] = 'archivos' ; $ 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' ] = FALSO ; $ 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' ] = FALSE ; $ config [ 'csrf_token_name' ] = 'csrf_test_name' ; $ config [ 'csrf_cookie_name' ] = 'csrf_cookie_name' ; $ 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 ' ] = ' ' ; Alquien me puede ayudar por favor, estaria muy agradecido
Try this one:
Code: <IfModule mod_rewrite.c> What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
i tried whit this but only said ERROR 500 , help!!!!
(02-12-2018, 04:15 AM)InsiteFX Wrote: Try this one: |
Welcome Guest, Not a member yet? Register Sign In |