2014-01-09 2 views
1

나는 Baker Framwork Cloud Console을 depoly하려고하는데 URL이 제대로 리디렉션되지 않는 것을 제외하고는 모든 것이 잘 진행되었습니다.Google AppEngine PHP URL이 올바르게 리디렉션되지 않음 (루프)

http://bake-console.appspot.com/index.php/admin/ 

하지만 URL은 다음과 같이 (루프) 리디렉션지고 :

URL은 내가 필요

http://bake-console.appspot.com/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/index.php/admin/login 

내 애플리케이션 제목 :

application: bake-console 
version: 1 
runtime: php 
api_version: 1 

handlers: 
- url: /.* 
    script: index.php 

- url: /(.+) 
    script: index.php 

- url: /media 
    static_dir: media 

모든 일이 작동 괜찮아요.

저는 app.yaml을 다시 작성하면 문제가 있다고 생각합니다.

미리 감사드립니다. @IanGSY에

+1

첫 번째 처리기 /.*는 모든 것과 일치 할 것이고 두 번째 두 개는 결코 일치하지 않을 것입니다. 아마 아래쪽으로 이동하려고 할 것입니다. – IanGSY

+0

고마워요 @IanGSY 그냥 고정 답변을 게시 할 :) – user3155632

답변

1

덕분에 난 그냥 그것을 파악하고 여기에

내 애플리케이션 제목을

application: bake-console 
version: 1 
runtime: php 
api_version: 1 

handlers: 
- url: /media/(.*\.(css$|js$|png$)) 
    static_files: media/\1 
    upload: media/(.*\.(css$|js$|png$)) 
    application_readable: true 

- url: /(.+)?/? 
    script: index.php 
    secure: always 

- url: /.* 
    script: index.php 

하고 심지어

$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); 

// Provide mod_rewrite like functionality. If a php file in the root directory 
// is explicitely requested then load the file, otherwise load index.php and 
// set get variable 'q' to $_SERVER['REQUEST_URI']. 
if (dirname($path) == '/' && pathinfo($path, PATHINFO_EXTENSION) == 'php') { 
    $file = pathinfo($path, PATHINFO_BASENAME); 
} 
else { 
    $file = 'index.php'; 
    // Provide mod_rewrite like functionality by using the path which excludes 
    // any other part of the request query (ie. ignores ?foo=bar). 
    $_GET['q'] = $path; 
} 
// Override the script name to simulate the behavior without wrapper.php. 
// Ensure that $_SERVER['SCRIPT_NAME'] always begins with a/to be consistent 
// with HTTP request and the value that is normally provided (not what GAE 
// currently provides). 
$_SERVER['SCRIPT_NAME'] = '/' . $file; 

// Redirect to controller only if controller is set in URL 
if(isset($_GET['q']) && $_GET['q'] != "//") { 
    header("Location /index.php/" . $_GET['q']); 
} 
AppEngine에 문서에서 발견 된이 코드 조각을 추가

을 그것을 고정

Google Appengine의 모든 codeigniter 앱에 적용 할 수 있습니다.

관련 문제