2017-05-23 2 views
0

CakePHP를/응용 프로그램/htaccess로서버가 로컬 호스트가 아닌 서버에서 404 오류를주고있다

<IfModule mod_rewrite.c> 
    RewriteBase/
    RewriteEngine on 
    # Uncomment if you have a .well-known directory in the app folder, e.g. for the Let's Encrypt challenge 
    # https://tools.ietf.org/html/rfc5785 
    #RewriteRule ^(\.well-known/.*)$ $1 [L] 
    RewriteRule ^$ webroot/ [L] 
    RewriteRule (.*) webroot/$1 [L] 
</IfModule> 

CakePHP의/htaccess로

<IfModule mod_rewrite.c> 
    RewriteBase/
    RewriteEngine on 
    # Uncomment if you have a .well-known directory in the root folder, e.g. for the Let's Encrypt challenge 
    # https://tools.ietf.org/html/rfc5785 
    #RewriteRule ^(\.well-known/.*)$ $1 [L] 
    RewriteRule ^$ app/webroot/ [L] 
    RewriteRule (.*) app/webroot/$1 [L] 
</IfModule> 

CakePHP를/응용 프로그램/webRoot/.htaccess

<IfModule mod_rewrite.c> 
     RewriteBase/
    RewriteEngine On 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteRule^index.php [L] 
</IfModule> 

mode_rewrite도 사용 가능합니다. 또한 올바른 서버도 404 오류가 아닙니다. 는 CSS와 JS 파일의

<link href="css/bootstrap.min.css" rel="stylesheet"> 


    <link href="/css/metisMenu.min.css" rel="stylesheet"> 


    <link href="/css/timeline.css" rel="stylesheet"> 


    <link href="/css/sb-admin-2.css" rel="stylesheet"> 


    <link href="/css/morris.css" rel="stylesheet"> 

없음 loading.only의 CakePHP CSS를 loading.I 루트에 파일의 소유권을 변경하지 않습니다와 나는 또한 응용 프로그램/tmp를

+0

'.htaccess' 파일이 서버에 있는지 확인하십시오. 때로는 숨겨진 파일로 누락 될 수도 있습니다. –

+0

"cakephp css 만로드 중입니다."- cakephp.css' (?)는 가지고있는 코드에서도 참조되지 않습니다. 게시 된? 'cakephp'는'cakephp/.htaccess'의 서브 디렉토리입니까? 그렇다면 CSS URL은 게시 한'.htaccess' 파일의 영향을받지 않습니까? 상대적인 첫 번째 것을 제외하고. – MrWhite

+0

예 .htaccess 파일도 서버에도 있습니다. 또한 웹 루트에 대한 사용 권한도 775로 변경했습니다. – Manasa

답변

0

에 775 파일 권한을 부여해야 내가 cakephp에 cakephp에 실수입니다. 모든 CSS는 js 파일은 애플 리케이션/webroot에 배치해야하지만 그들에게 루트 폴더 자체를 배치. 내가 webroot www에 액세스 할 수있는 파일을 배치. 당신의 도움에 감사드립니다.

관련 문제