2017-02-08 1 views
0

개발 된 ExpressionEngine 사이트에 도움을 요청 받았습니다. 이 잘 작동하고Apache 재 작성/product/to/products/및 index.php

RewriteEngine On 
RewriteBase/
# Not a file or directory (also catches index.php) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /index.php?$1 [L] 

예를 들어 URL이 될 수 있습니다 :

WWW은 index.php를 통해 들어가도록 파일이나 디렉토리가 아닌 것은 다시 쓰는 기존의 .htaccess 파일이 있습니다 (단수

www.mysite.com/product/foo : 사이트 .co.kr/제품/foo는 (복수 '제품')

그러나, 그것은 또한 형태가 될 것이다 된 URL을 처리 할 필요가 '제품')

나는 다음 시도했다 :이 '제품'을 발견하면 그때는 종료 후 index.php를 통해에 '제품을'다시 쓰는 것을 기대

RewriteEngine On 
RewriteBase/
# Not a file or directory (also catches index.php) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^product/(.+) /index.php/products/$1 [L] 
RewriteRule ^(.*)$ /index.php?$1 [L] 

,하지만 작동하지 않습니다.

/부서/부문/foo는

greatefully받은 어떤 도움 :

/부서/foo는 가에 다시 쓸 : 동시에

, 나는 시작하는 들어오는 URL이 필요합니다.

+0

게시물 당 하나 개의 질문을하십시오. – anubhava

답변

1

당신은 매핑 product -> products에 대한 귀하의 기존 규칙 위의 규칙을 추가 사용할 수 있습니다

RewriteEngine On 
RewriteBase/

RewriteRule ^product(/.*)?$ products$1 [L,NC] 

# Not a file or directory (also catches index.php) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /index.php?$1 [L] 
관련 문제