Lỗi về việc bị logout khi bấm vào link khác

Thảo luận trong 'Reports & Fix Bug' bắt đầu bởi vntrick, 21/10/14.

1votes
5/5, 1 vote

  1. vntrick

    vntrick Member

    Bài viết:
    95
    Likes :
    15
    Tình hình là hơi bị hài ở chỗ: Mình đăng nhập vào forum ở dạng abc.com/forums, nhưng khi gõ vào trình duyệt là www.abc.com/forums thì thấy mình out, gõ lại abc.com/forums thì lại thấy đăng nhập, vậy là có vấn đề ở cái cache user với www hoặc non-www? Bác nào giải quyết vụ này giúp em với :) Thanks!
     
    Đang tải...
  2. Bcat9505

    Bcat9505 Moderator Staff Member

    Bài viết:
    1,335
    Likes :
    494
    k phải out mà là site bạn có 2 dạng đó là www và non www chỉ cần bỏ 1 trong 2 đi là đc.
     
  3. vntrick

    vntrick Member

    Bài viết:
    95
    Likes :
    15
    Ah được rồi! cùng là 1 dạng này:
    Mã:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
    nhưng khi mình thêm riêng vào cuối .htaccess thì không được, nhưng khi chèn thêm trong đoạn mã gốc gần trên cùng .htaccess của XEN như này thì lại được.
    Mã:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
    
        #   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) - [NC,L]
        RewriteRule (robots\.txt)$ robots.php [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
    </IfModule>
    Chả hiểu tại sao luôn.
     
comments powered by Disqus

Chia sẻ trang này

Đang tải...