2013-09-08 3 views
0

하나의 도메인을 제외한 모든 하위 도메인을 상위 도메인으로 리디렉션하는 htaccess가 있습니다.godaddy에서 htaccess 리디렉션 문제

RewriteEngine On 
RewriteCond %{HTTP_HOST} ^([^.]+)\.theonlytutorials\.com$ [NC] 
RewriteCond %1 !^(blog|www)$ [NC] 
RewriteRule ^(.*)$ http://theonlytutorials.com/$1 [L,R=301] 

이 코드는 이전 호스팅에서 올바르게 작동했습니다. 하지만 Godaddy에서는 작동하지 않는 것 같습니다.

리디렉션되지만 정확한 호스팅 위치로 전송됩니다. 내 URL 구조의

한 대신

www.theonlytutorials.com/video/58/4496/ChessBaseGmbH 

가 리디렉션되는 :

www.theonlytutorials.com/others/tutorials/video/58/4496/ChessBaseGmbH 

경우 다른 내가 가서 아빠에

+0

당신이 중 하나를 그렇게 다른 규칙을 가지고, 또는 스크립트가 수행 , 또는 다른 사용자가 리디렉션 한 것으로부터 캐싱되었습니다. – Prix

답변

0

를 호스팅에서 만든 폴더입니다/자습서 (및 다른 일부 호스트) 사이트 폴더 이름은 리디렉션 코드에 포함되어야합니다. 다른 사이트에/블로그/폴더/사이트에서 링크를 리디렉션하고 싶었다면

RedirectMatch 301 ^/site-folder-name/video/58/4496/ChessBaseGmbH/$ http://the full URL here where you want the redirect point to 

RedirectMatch 301 ^/blog/video/58/4496/ChessBaseGmbH/$ http://the full URL here where you want the redirect point to 

의 당신이 폴더/기타에있는 사이트에서 리디렉션을 수행 할 가정 해 봅시다/그리고 루트 도메인으로 리디렉션하려고합니다.

RedirectMatch 301 ^/others/video/58/4496/ChessBaseGmbH/$ http://the full URL here to your root domain where you want the redirect to point to 

그리고이 폴더 구조/기타/다른 중첩 된 폴더가있는 경우 논리적으로 동일한 것은 아마도 사실 일 것입니다/

RedirectMatch 301 ^/others/another-nested-folder/video/58/4496/ChessBaseGmbH/$ http://the full URL here to your root domain where you want the redirect to point to