찾다

 >  Q&A  >  본문

접속경로 http://tp6.com/index.php/index/index/admin

인덱스 파일 아래에 넣어서 선생님 지시에 따라 접근하면 접근하기 전에 경로가 이렇게 되는 이유는 무엇인가요?

http://tp6.com/index.php/index/index/admin

尘世*จุ๊บ尘世*จุ๊บ1721일 전2880

모든 응답(2)나는 대답할 것이다

  • WJ

    WJ2020-05-20 09:27:52

    여기에 언급된 항목 파일은 public/index.php 파일을 참조합니다. 구성 파일은 이 디렉터리에 있습니다. URL 주소에서 항목 파일 index.php를 제거할 수 있지만 웹 서버의 다시 쓰기 규칙을 구성해야 합니다. 추가적으로. Apache를 예로 들어 파일 항목이 필요한 동일한 수준에 .htaccess 파일을 추가하면(기본적으로 공식 파일이 함께 제공됨) 내용은 다음과 같습니다.

    <IfModule mod_rewrite.c>
    Options +FollowSymlinks -Multiviews
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/ [QSA,PT,L]
    </IfModule>
    如果用的phpstudy,规则如下:
    <IfModule mod_rewrite.c>
     Options +FollowSymlinks -Multiviews
     RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:] 
     </IfModule>

    회신하다
    0
  • 尘世*จุ๊บ

    안녕하세요, 답변해 주셔서 감사합니다. 문제는 해결되었지만 이제 내부의 hello 메소드가 아닌 index 메소드에만 액세스할 수 있습니다. appindexcontrollerHello:

    尘世*จุ๊บ · 2020-05-20 12:36:54
  • 취소회신하다