2011-04-23 2 views
0

여기 제가 직면 한 이상한 문제가 있습니다. 브라우저에서 www.example.com에 액세스하면 문제가없는 것으로 나타납니다. www.example.com/dev 또는 www.example.com/dev/admin과 같은 루트 아래의 dev 폴더에있는 사이트에 액세스하면 빈 페이지가 표시되고 오류가 발생했습니다라는 오류 페이지가 표시됩니다 기본 제어기. Routes.php 파일에 지정된 컨트롤러가 유효한지 확인하십시오.루트의 www.example.com은 표시되지만 www.example.com/dev/admin은 오류를 나타냅니다.

나는 그것을 몇 가지 예외가 Router.php 파일에 있었다지고 있음을 발견 더 디버깅에 CodeIgniter는 프레임 워크와 PHP의 V 5.0

을 사용하고 있습니다.

_set_request에서 메서드 _validate_request에 대한 주석을 작성하면 작업이 시작되었습니다. 그러나 일부 페이지는 여전히 작동하지 않습니다. 이 페이지의 컨트롤러는 여기에 config.php를

$config['base_url']  = "http://example.com/dev/"; 
#$config['index_page'] = "index.php"; 
$config['index_page'] = ""; 
#$config['uri_protocol']  = "AUTO"; 
$config['uri_protocol'] = "REQUEST_URI"; 

$config['url_suffix'] = ""; 

$config['language']  = "english"; 

$config['charset'] = "UTF-8"; 

$config['enable_hooks'] = FALSE; 

$config['subclass_prefix'] = 'MY_'; 

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_=?&\-'; 

$config['enable_query_strings'] = TRUE; 
$config['controller_trigger'] = 'c'; 
$config['function_trigger']  = 'm'; 
$config['directory_trigger'] = 'd'; // experimental not currently in use 

$config['log_threshold'] = 4; 

$config['log_path'] = ''; 

$config['log_date_format'] = 'Y-m-d H:i:s'; 
$config['cache_path'] = ''; 

$config['encryption_key'] = ""; 

$config['sess_cookie_name']    = 'ci_session'; 
$config['sess_expiration']    = 7200; 
$config['sess_encrypt_cookie'] = FALSE; 
$config['sess_use_database'] = FALSE; 
$config['sess_table_name']    = 'ci_sessions'; 
$config['sess_match_ip']    = FALSE; 
$config['sess_match_useragent'] = TRUE; 
$config['sess_time_to_update'] = 7200; 

$config['cookie_prefix']  = ""; 
$config['cookie_domain']  = ""; 
$config['cookie_path']   = "/"; 

$config['global_xss_filtering'] = FALSE; 

$config['compress_output'] = FALSE; 

$config['time_reference'] = 'local'; 

$config['rewrite_short_tags'] = FALSE; 

$config['proxy_ips'] = ''; 

/* 
|-------------------------------------------------------------------------- 
| CUSTOM CONFIGURATION SETTINGS 
|-------------------------------------------------------------------------- 
| 
| 
*/ 

// Table Prefix 
$config['tableprefix'] = ''; 

// CSS Path 
$config['css_path'] = 'assets/css/'; 

// JS Path 
$config['js_path'] = 'assets/js/'; 

// Image Path 
$config['images_path'] = 'assets/images/'; 

// Upload Path 
$config['upload_path'] = 'assets/upload/'; 

// Email Template Path 
$config['email_template_path'] = 'assets/email/'; 

// Allowed Upload Image Extensions 
$config['allowed_types'] = 'gif|jpg|png|bmp|jpeg'; 

// Allowed Upload File Max Size 
$config['max_size'] = '10240'; 

// Email Settings 
//$config['admin_to_email'] = '[email protected]'; 
$config['admin_to_email'] = '[email protected]'; 
$config['noreply_email'] = '[email protected]'; 
$config['noreply_name'] = 'yyyyy'; 

// Page Settings 
$config['page_title'] = 'yyyy'; 
$config['meta_description'] = ''; 
$config['meta_keywords'] = ''; 
$config['meta_author'] = ''; 

## Uploaded Image Size Setting 
// Image Sizes 
$config['ad_100X100'] = '100X100_'; 

The following is in routes.php 
$route['default_controller'] = "home"; 
$route['scaffolding_trigger'] = ""; 

The value in .htaccess 
RewriteEngine on 
RewriteCond $1 !^(index\.php|assets|fckeditor|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.+)$ index.php?$1 [L,QSA] 

많이 이해할 수있을 것이다이 문제를 해결하기 위해 어떤 도움이다

www.example.com/dev/system/application/controllers/admin

내부에 있습니다.

+0

dev 폴더에 루트 폴더의 파일 복제본이 있다고 가정합니까? 즉, abc.com의 개발 영역입니까? –

+1

"ping"은 ICMP 패킷을 사용하여 IP 주소 또는 도메인을 테스트하는 것을 의미합니다. 따라서 "www.abc.com"과 같은 주소를 핑 (ping) 할 수는 있지만 폴더 나 파일을 ping 할 수는 없습니다. 그냥 FYI입니다. (혼란스럽고 다른 사람들을 혼동시킬 수 있습니다.) –

+2

또 다른 참고 사항 : example.com은 관련성이없고 실제 웹 사이트를 가리킬 위험없이 도메인 예제를 제공하기 위해 예약되어 있습니다. –

답변

1

dev 폴더가 abc.com의 개발 영역이거나 정적 사이트 일 뿐이라고 가정하고 있습니까? 그러나.

abc.com/.htacces 파일에서 devc 폴더를 다시 작성하지 않으므로 abc.com의 codeigniter가 해당 폴더에 대한 요청을 처리하지 못합니다.

RewriteCond $1 !^(index\.php|assets|fckeditor|dev|robots\.txt) 
관련 문제