2014-01-09 2 views
0

을 재 지정 제외 excluded_file.php라는 파일 하나에 대해. 그러나 실제로는 "excluded_"(excluded_1.php, excluded_2.php, excluded_3.php)로 시작하는 요청 된 모든 파일과 "olddomainfiles"폴더에있는 파일에 대한 모든 요청을 제외해야합니다. 그래서 최종 결과는 다음과 같습니다아파치에서 VirtualHost 여러 파일 및 도메인에서 폴더가이 코드를 사용하여

이 newdomain.com/whatevertherequestwasfor로 리디렉션됩니다 :

http://olddomain.com/somerandomfile.php 
http://olddomain.com/otherfolders/whateverfile.php 
http://olddomain.com/nice_URL_without_file_extension_or_slash 

리디렉션되지 않습니다

http://olddomain.com/olddomainfiles/anyfile.php 
http://olddomain.com/exclude_1.php 
http://olddomain.com/exclude_2.php 
http://olddomain.com/exclude_3.php 

을 나는이 필요한 이유 : 난 그냥 제출 내 응용 프로그램을 애플에 보내고, 막판에 도메인 이름을 변경해야한다고 결정했습니다.이 이름은 이전 도메인 이름을 볼 때 명시 적으로 의존하기 때문에 응용 프로그램의 기능을 손상시킵니다. 가상 호스트 파일의 변경으로 인해 더 이상 표시되지 않습니다. 며칠 전에이 문제에 대해 게시했지만 필요한 부분이 잘못되었습니다 ...

답변

1

이 기능이 작동하지 않습니까?

RedirectMatch 301 ^((?!.*?(excluded.*\.php|olddomainfiles)).*)$ http://newdomain.com$1 

은 그냥 (이전 excluded_file\.php 찾고 된) 앞서 부정적인 모양을 변경할 수 excluded.*\.php 또는 olddomainfiles 중 하나의 옵션이 될 필요가 있었다.

+0

Perfect! 'excluded. * \. php'에 언더 스코어를 추가했습니다. 감사! – tylerl