2014-10-07 6 views
1

작동하지리디렉션 htaccess로 내가 <a href="https://xyz.com" rel="nofollow">https://xyz.com</a></p> <p>내 코드에 xyz.com을 리디렉션하기 위해 노력하고있어

# BEGIN WordPress 
RewriteEngine On 
RewriteBase/

RewriteCond %{HTTP_HOST} ^xyz.com$ 
RewriteRule ^(.*)$ https://xyz.com/$1 [R=301] 

RewriteRule ^index\.php$ - [L] 

# add a trailing slash to /wp-admin 
RewriteRule ^wp-admin$ wp-admin/ [R=301,L] 

RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule^- [L] 
RewriteRule ^(wp-(content|admin|includes).*) $1 [L] 
RewriteRule ^(.*\.php)$ $1 [L] 
RewriteRule . index.php [L] 
RewriteRule ^(.*/)?sitemap.xml wp-content/sitemap.php [L] 

# END WordPress 

또한 다음 코드를 시도

RewriteEngine On 
RewriteBase/
RewriteCond %{HTTPS} off 
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC] 
RewriteRule ^(.*)$ https://%1/$1 [R=301,L] 

을 이 오류를 보여줍니다. 페이지가 제대로 리디렉션되지 않습니다.

실제로는 WordPress 사이트입니다.

어떻게 해결할 수 있습니까? 사전

답변

2

에서

덕분에이 같은 규칙 유무 :

또한
RewriteEngine On 
RewriteBase/

RewriteCond %{HTTPS} off [OR] 
RewriteCond %{HTTP_HOST} ^www\. [NC] 
RewriteRule^https://xyz.com%{REQUEST_URI} [R=301,L] 

당신의 WP의 영구 링크 설정에서 확인하십시오, 당신은 homehttps://xyz.com/

+0

작동하지 않습니다. 답장을 보내 주셔서 감사합니다 –

+1

누군가가'작동하지 않습니다'라는 의견을 어떻게 처리 할 수 ​​있다고 생각하십니까 :) 세부 사항을 제공하십시오. 어떤 URL을 입력 했습니까? 이것이 WP .htaccess의 첫 번째 규칙입니까? ** WP permalink 설정 **을 변경 했습니까? – anubhava

+0

xyz.com/sample-post/ its my wp permalink –

1

가 아래의 코드를 추가하십시오 반영 site URL .htaccess 파일을 사용하여 전체 사이트를 https로 리디렉션하십시오.

RewriteEngine On 
RewriteCond %{HTTPS} !=on 
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L] 

선택한 페이지를 리디렉션하려면 다음과 같이 규칙을 다시 작성하십시오.

RewriteRule ^page1(.*) https://%{SERVER_NAME}/page1$1 [R,L] 

당신이 플러그인을 선호하는 경우, 당신은이 플러그인을 사용할 수 있습니다 https://wordpress.org/plugins/https-redirection/를.

1

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.xyz.com/$1 [R,L] 
1

당신의 .htaccess 파일에이 코드를 추가하고 나에게 일을 알려 주시기 바랍니다 것이 작동하고이를보십시오.

RewriteEngine On 
RewriteCond %{HTTPS} off 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} 

이 코드는 내 사이트에서 제대로 작동합니다. 호스팅 업체에서 SSL 인증서를 가지고 있는지 확인하십시오.

이 링크 확인 http://kuldipmakdiya.wordpress.com/2014/10/14/redirect-htaccess-to-ssl-is-not-working/

+0

다른 모든 사이트에서 작업하고 있습니다. 하지만 네트워크 사이트에서 작동하지 않습니다. 나는 그것의 나의 워드 프레스 설정 문제입니다. –

관련 문제