2011-01-27 11 views
1

.htaccess 파일에 코드를 다시 작성했습니다. 나는 워드 프레스에 정적 HTML 사이트를 이동하고 다음을 작업하기 필요 :301 리디렉션이 Wordpress에서 작동하지 않습니다.

  1. http://www.domain.com.au/

에 내가 할 수없는 index.html을 http://domain.com.au/

  • http://www.domain.com.au/로 리디렉션 (이전의 정적 홈 페이지) 리디렉션 어느 쪽이든을하기 위하여 나가, 나는 건의 된 각종 방법을 시도했다. domain.com.au ~ http://www.domain.com.au은 홈페이지를 제외한 모든 페이지에서 작동합니다 (예 : http://domain.com.au/ourteamhttp://www.domain.com.au/ourteam

    으로 리디렉션되지만 루트 (홈 페이지)는 리디렉션되지 않습니다.

    또한 index.html 리디렉션에 대한 페이지를 찾을 수 없습니다.

    내 htaccess로 파일은 다음과 같습니다

    Options +FollowSymlinks 
    RewriteEngine on 
    ### re-direct index.html to root 
    RewriteCond %{THE_REQUEST} ^.*\/index\.html 
    RewriteRule ^(.*)index\.html$ /$1 [R=301,L] 
    ### non www to www 
    RewriteCond %{HTTP_HOST} ^domain\.com\.au$ [NC] 
    RewriteRule ^(.*)$ http://www.domain.com.au/$1 [R=301,L] 
    
    redirect 301 /team.html http://www.domain.com.au/our-team/ 
    redirect 301 /contact.html http://www.domain.com.au/contact-us/ 
    

    누군가의 도움이 -이 내 머리를 찢어있다!

  • +0

    나는 비슷한 문제가 있습니다. 나는 Cpanel Redirects, Wordpress 플러그인을 사용해 보았는데,이 코드를 .htaccess에 추가했지만 아무것도 작동하지 않는 것 같습니다. 그러나 다른 웹 사이트에서도 동일한 코드를 사용할 수 있습니다. – Kandinski

    답변

    2

    미안 해요, 난 그냥이에 문제가 발견했다 : 아파치 당신의 리디렉션에 도달 결코 다시 작성을 처리하지 않고로 Using htaccess to 301 redirect, not working

    은 분명히 당신이 #begin 워드 프레스 위의 리디렉션을 넣어해야합니다.

    0

    시도 :

    <IfModule mod_rewrite.c> 
    Options +FollowSymlinks 
    RewriteEngine on 
    
    ### non www to www 
    RewriteCond %{HTTP_HOST} ^domain.com.au [NC] 
    RewriteRule ^(.*)$ http://www.domain.com.au/$1 [R=301,L] 
    
    ### re-direct index.html to root 
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/ 
    RewriteRule ^index\.html$ http://www.domain.com.au/ [R=301,L] 
    
    redirect 301 /team.html http://www.domain.com.au/our-team/ 
    redirect 301 /contact.html http://www.domain.com.au/contact-us/ 
    
    # WrodPress rules begin here... 
    </IfModule> 
    
    0

    당신이 작동 할 수있는 유일한 방법입니다 재 작성 형식으로 301 리디렉션을 설정해야합니다 rewrite 규칙을 사용한다.

    RewriteRule ^/team.html$ http://www.domain.com.au/our-team/ [R=301,L] 
    
    관련 문제