2017-05-01 1 views
1

에서 개발 한 워드 프레스 사이트 www가 비 WWW의 오류를 리디렉션 login.php, wp-admin). 예 :사용자 정의 페이지 내 워드 프레스 사이트의 <code>web.config</code>에이 코드를 추가 한 마이크로 소프트 푸른

  1. 내가 poudelmadhav.com 나는 그것이 www.poudelmadhav.com/ 리디렉션 poudelmadhav.com/wp-login.php 링크로 이동하는 경우가 www.poudelmadhav.com
  2. 로 리디렉션을 링크로 이동합니다 WP-login.php

하지만 워드 프레스를 설치 한 후 만든 워드 프레스의 사용자 정의 페이지에서이 doesnot 작동합니다.

  1. 나는 그것이 내가 poudelmadhav.com/about-me을 가고 싶은 경우
  2. 을 www.poudelmadhav.com/contact하지 www.poudelmadhav.com로 리디렉션 poudelmadhav.com/contact 가고 싶은 경우 : 예를 들어 그것은 내가이 저를 도와주세요 해결할 수있는 방법 here. 의 지침을 따랐다

www.poudelmadhav.com/about-me하지 www.poudelmadhav.com로 리디렉션합니다.

답변

0

내 사이트에서 문제를 재현 할 수있었습니다. 이 문제를 해결하려면 위에 게시 한 코드를 Rewrite to index.php 규칙 앞에 web.config 파일로 옮겨야합니다. 그리고 테스트 할 때 웹 브라우저의 캐시를 지우는 것을 잊지 마십시오.

<?xml version="1.0" encoding="UTF-8" ?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 

       <rule name="Redirect to WWW site"> 
        <match url=".*" /> 
        <conditions logicalGrouping="MatchAny"> 
         <add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" negate="true" /> 
        </conditions> 
        <action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" redirectType="Permanent" /> 
       </rule> 

       <rule name="Rewrite to index.php" patternSyntax="Wildcard"> 
        <match url="*" /> 
        <conditions> 
         <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
        </conditions> 
        <action type="Rewrite" url="index.php" /> 
       </rule> 

      </rules> 
     </rewrite> 
    </system.webServer> 
</configuration> 
+0

@Aron. 내 문제가 해결되었습니다. 너는 나의 위대한 영감이다 ... – Achyut

관련 문제