모듈 재 작성 구문에 대한 질문이 있습니다. 나는 어떤 파일을 포함하거나 포함하지 않는 규칙을 작성하는 법을 알고 싶다. 예를 들어모듈 다시 쓰기의 구문 정보
:
디렉토리 구조 :
- /
- /home.php/페이지
- /profile.php
- /페이지/인덱스. PHP
- /pag ES/htaccess로 /pages/index.php 내용 정보
:
<?php include_once "../home.php" ?>
/home.php 내용 정보 : 그래서
<a href="profile.php">Profile</a>
: 나는 쓰기 싶습니다 .htaccess를 pages 디렉토리에두고 사용자가 프로필 텍스트를 클릭하면 하이퍼 링크 (profile.php)가 올 바릅니다.
RewriteEngine On
RewriteBase /pages2
RewriteRule ^(images|css|js|plugins)/(.*) http://localhost/$1/$2
# if end with .php ext and file name not index.php then redirect to parent directory
RewriteCond %{SCRIPT_FILENAME} .php$
RewriteCond %{SCRIPT_FILENAME} !index.php$ ## not work ?
RewriteRule ^(.*) http://localhost/$1
이 경우 루트 경로 파일 내용을 변경할 수 없습니다.
우선 할 :) 필요로하지 않는다 "RewriteRule의의 % {SCRIPT_FILENAME}! index.php를 $ [NC]가"정말 대신한다 RewriteCond해야한다, 및 [NC]는 제거해야합니다. – SirDarius
무엇을 묻고 있는지 확실하지 않습니다 !! – Vijay
먼저 답을 찾아야합니다. 이상한 .htaccess 파일의 목적은 무엇입니까 –