Hướng dẫn Chuyển từ http sang https cho xenforo

lacluoc

Corporal
Tham gia
03/11/2015
Bài viết
146
Được Like
71
Lọ mọ tìm test và cuối cùng tìm được một cái chạy ok, có thể là tùy site. Ở đây mình sẽ hướng dẫn ai đang có nhu cầu thì táng zô, sửa dụng file htaccess nhé các thím

Nhét đoạn mã này zô file htaccess
Mã:
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

File hoàn chỉnh với www ví dụ với tinhte.vn
Mã:
#   Mod_security can interfere with uploading of content such as attachments. If you
#   cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#   SecFilterEngine Off
#   SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 406 default
ErrorDocument 500 default
ErrorDocument 501 default
ErrorDocument 503 default

<IfModule mod_rewrite.c>
   RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
  RewriteCond %{HTTP_HOST} !^www.tinhte\.vn$ [NC]
  RewriteRule ^(.*)$ http://www.tinhte.vn/$1 [R=301,L,QSA]

   #   If you are having problems with the rewrite rules, remove the "#" from the
   #   line that begins "RewriteBase" below. You will also have to change the path
   #   of the rewrite to reflect the path to your XenForo installation.
   #RewriteBase /xenforo

   #   This line may be needed to enable WebDAV editing with PHP as a CGI.
   #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

   RewriteCond %{REQUEST_FILENAME} -f [OR]
   RewriteCond %{REQUEST_FILENAME} -l [OR]
   RewriteCond %{REQUEST_FILENAME} -d
   RewriteRule ^.*$ - [NC,L]
   RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
   RewriteRule ^.*$ index.php [NC,L]
</IfModule>

Và một cái nữa là ta thống nhất về www or none-www bằng code dưới đây
Mã:
rewrite to www. Code:

        RewriteCond %{HTTP_HOST} !^www.example\.com$ [NC]
        RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L,QSA]

or to non-www Code:

        RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
        RewriteRule ^(.*)$ http://example.com/$1 [R=301,L,QSA]
ở footer mình có chèn link quảng cáo cho một trang khác ko có https, nên trang của mình ko hiển thị https màu xanh, nếu mình xóa link đó thì https của mình xanh luôn. làm thế nào để khắc phục được bạn
 

sonvu989

Gefreiter
Tham gia
20/12/2015
Bài viết
54
Được Like
31
chào mọi người !

Cần mọi người trợ giúp tý

Web mình là chogoviet.net mới chạy https . mình có gặp lỗi như sau khi gõ trực tiếp vào địa chỉ web chogoviet.net thì chuyển hướng ngay đến www.chogoviet.net ( không mong muốn )


mình phải gõ hẳn https://chogoviet.net/forums/ thì nó mới như mình mong muốn .

Vậy mình muốn gõ chogoviet.net nó chuyển hướng luôn đến https://chogoviet.net/forums/ . Mọi người giúp với !
 

NDK

MasterSergeant
Tham gia
16/03/2015
Bài viết
830
Được Like
743
chào mọi người !

Cần mọi người trợ giúp tý

Web mình là chogoviet.net mới chạy https . mình có gặp lỗi như sau khi gõ trực tiếp vào địa chỉ web chogoviet.net thì chuyển hướng ngay đến www.chogoviet.net ( không mong muốn )


mình phải gõ hẳn https://chogoviet.net/forums/ thì nó mới như mình mong muốn .

Vậy mình muốn gõ chogoviet.net nó chuyển hướng luôn đến https://chogoviet.net/forums/ . Mọi người giúp với !
Bạn sửa lại Board Information chưa , mục Home page URL ý
 

sonvu989

Gefreiter
Tham gia
20/12/2015
Bài viết
54
Được Like
31
ảnh
 

Đính kèm

  • Screenshot (46).png
    Screenshot (46).png
    238.5 KB · Lượt xem: 8

sonvu989

Gefreiter
Tham gia
20/12/2015
Bài viết
54
Được Like
31
Screenshot (46).png
 

NDK

MasterSergeant
Tham gia
16/03/2015
Bài viết
830
Được Like
743
Mã:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.chogoviet.net
RewriteRule ^.*$ https://chogoviet.net%{REQUEST_URI} [R=301,L]
Bạn thử chèn code này chưa ?
Trong phần Board Url bạn để link thế nào ? Phần này sẽ để đường link chính khi vừa gõ domain vào đấy
 

vntoday007

Corporal
Tham gia
17/11/2015
Bài viết
104
Được Like
97
chào mọi người !

Cần mọi người trợ giúp tý

Web mình là chogoviet.net mới chạy https . mình có gặp lỗi như sau khi gõ trực tiếp vào địa chỉ web chogoviet.net thì chuyển hướng ngay đến www.chogoviet.net ( không mong muốn )


mình phải gõ hẳn https://chogoviet.net/forums/ thì nó mới như mình mong muốn .

Vậy mình muốn gõ chogoviet.net nó chuyển hướng luôn đến https://chogoviet.net/forums/ . Mọi người giúp với !

Code hoàn chỉnh của bạn trong file .htaccess bạn thử copy rồi save lại xem

Mã:
#   Mod_security can interfere with uploading of content such as attachments. If you
#   cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#   SecFilterEngine Off
#   SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 406 default
ErrorDocument 500 default
ErrorDocument 501 default
ErrorDocument 503 default

<IfModule mod_rewrite.c>
   RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
  RewriteCond %{HTTP_HOST} !^chogoviet\.net$ [NC]
  RewriteRule ^(.*)$ http://chogoviet.net/$1 [R=301,L,QSA]

   #   If you are having problems with the rewrite rules, remove the "#" from the
   #   line that begins "RewriteBase" below. You will also have to change the path
   #   of the rewrite to reflect the path to your XenForo installation.
   #RewriteBase /xenforo

   #   This line may be needed to enable WebDAV editing with PHP as a CGI.
   #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

   RewriteCond %{REQUEST_FILENAME} -f [OR]
   RewriteCond %{REQUEST_FILENAME} -l [OR]
   RewriteCond %{REQUEST_FILENAME} -d
   RewriteRule ^.*$ - [NC,L]
   RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
   RewriteRule ^.*$ index.php [NC,L]
</IfModule>
 

Hướng dẫn sử dụng

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mr. Tuấn

Mobile/Zalo: 0988 488 096

Telegram: bluekpro

Email: [email protected]

Nhà Tài Trợ

Mút Xốp Không Gian
pallet Thịnh Phát
Top Bottom