2012-06-13 2 views
1

는 정말 같은 이전 사이트에서 설정되어 많은 페이지가 있습니다아파치에서 301 리디렉션을 어떻게 처리합니까?

http://www.domain.com/directory/onedirectory/whatever1 
http://www.domain.com/directory/onedirectory/whatever2 
http://www.domain.com/directory/onedirectory/whatever3 

http://www.domain.com/directory/anotherdirectory/whatever1 
http://www.domain.com/directory/anotherdirectory/whatever2 
http://www.domain.com/directory/anotherdirectory/whatever3 

는 기본적으로, 나는 '어떤'모든 디렉토리를 제거 왔를, 그래서 하나를 가지고 하나의 디렉토리 만이있다 페이지 (와의 index.php), 그래서 이제이 다음 '어떤'모든 디렉토리가 다시 부모로 리디렉션하도록

가 가
http://www.domain.com/directory/onedirectory 
http://www.domain.com/directory/anotherdirectory 

가 어떻게 그것을 만들 것 ? 나는 잃어 버렸다. 나는 많은 일을 시도했지만 아무도 일하지 못했고 대개 무한 루프를 만들어냅니다.

도움을 주셔서 감사합니다.

-Jeremy

답변

1

당신이하고 싶은 가장 좋은 것은 예를 들어 너무 mod_redirect을 사용하는 것입니다 : - 당신은 심지어이이 확장 및 인라인 substituions을 수행하는 정규 표현식을 사용할 수 있습니다

ReWriteRule /directory/onedirectory/whatever1 /directory/onedirectory 

일부 도움을 위해 this tutorial에서 들여다보기

관련 문제