Diễn đàn Trái Tim Yên Bái 2024

 Quên mật khẩu
 Đăng ký
Xem: 2839|Trả lời: 5
Thu gọn cột thông tin

DiscuzX Rewrite Rules

[Lấy địa chỉ]
  • Tâm trạng hàng ngày
    Hạnh phúc
    2-7-2025 09:43 PM
  • Đã viết: 13 ngày

    [LV.3]Spam 3

    Đăng lúc 10-5-2010 03:01 PM | Xem tất |Chế độ đọc

    Mời bạn đăng ký để giao lưu kết bạn nhé <3

    Bạn phải đăng nhập để xem được nội dung, nếu bạn chưa có tài khoản? hãy Đăng ký

    x
    Apache Web Server(獨立主機用戶)
    1. <IfModule mod_rewrite.c>
    2.         RewriteEngine On
    3.         RewriteCond %{QUERY_STRING} ^(.*)$
    4.         RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2&%1
    5.         RewriteCond %{QUERY_STRING} ^(.*)$
    6.         RewriteRule ^(.*)/article-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&%1
    7.         RewriteCond %{QUERY_STRING} ^(.*)$
    8.         RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1
    9.         RewriteCond %{QUERY_STRING} ^(.*)$
    10.         RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1
    11.         RewriteCond %{QUERY_STRING} ^(.*)$
    12.         RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3&%1
    13.         RewriteCond %{QUERY_STRING} ^(.*)$
    14.         RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3&%1
    15.         RewriteCond %{QUERY_STRING} ^(.*)$
    16.         RewriteRule ^(.*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3&%1
    17. </IfModule>
    Sao chép mã

    Apache Web Server(虛擬主機用戶)
    1. # 將 RewriteEngine 模式打開
    2. RewriteEngine On

    3. # 修改以下語句中的 /discuz 為你的論壇目錄地址,如果程序放在根目錄中,請將 /discuz 修改為 /
    4. RewriteBase /discuz

    5. # Rewrite 系統規則請勿修改
    6. RewriteCond %{QUERY_STRING} ^(.*)$
    7. RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
    8. RewriteCond %{QUERY_STRING} ^(.*)$
    9. RewriteRule ^article-([0-9]+)\.html$ portal.php?mod=view&aid=$1&%1
    10. RewriteCond %{QUERY_STRING} ^(.*)$
    11. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
    12. RewriteCond %{QUERY_STRING} ^(.*)$
    13. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
    14. RewriteCond %{QUERY_STRING} ^(.*)$
    15. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
    16. RewriteCond %{QUERY_STRING} ^(.*)$
    17. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
    18. RewriteCond %{QUERY_STRING} ^(.*)$
    19. RewriteRule ^([a-z]+)-(.+)\.html$ $1.php?rewrite=$2&%1
    Sao chép mã


    IIS Web Server(獨立主機用戶)
    1. [ISAPI_Rewrite]

    2. # 3600 = 1 hour
    3. CacheClockRate 3600

    4. RepeatLimit 32

    5. # Protect httpd.ini and httpd.parse.errors files
    6. # from accessing through HTTP
    7. RewriteRule ^(.*)/topic-(.+)\.html\?*(.*)$ $1/portal\.php\?mod=topic&topic=$2&$3
    8. RewriteRule ^(.*)/article-([0-9]+)\.html\?*(.*)$ $1/portal\.php\?mod=view&aid=$2&$3
    9. RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$4
    10. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$5
    11. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=group&fid=$2&page=$3&$4
    12. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/home\.php\?mod=space&$2=$3&$4
    13. RewriteRule ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$ $1/$2\.php\?rewrite=$3&$4
    Sao chép mã


    Zeus Web Server
    1. match URL into $ with ^(.*)/topic-(.+)\.html\?*(.*)$
    2. if matched then
    3.         set URL = $1/portal.php?mod=topic&topic=$2&$3
    4. endif
    5. match URL into $ with ^(.*)/article-([0-9]+)\.html\?*(.*)$
    6. if matched then
    7.         set URL = $1/portal.php?mod=view&aid=$2&$3
    8. endif
    9. match URL into $ with ^(.*)/forum-(\w+)-([0-9]+)\.html\?*(.*)$
    10. if matched then
    11.         set URL = $1/forum.php?mod=forumdisplay&fid=$2&page=$3&$4
    12. endif
    13. match URL into $ with ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$
    14. if matched then
    15.         set URL = $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$5
    16. endif
    17. match URL into $ with ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$
    18. if matched then
    19.         set URL = $1/forum.php?mod=group&fid=$2&page=$3&$4
    20. endif
    21. match URL into $ with ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$
    22. if matched then
    23.         set URL = $1/home.php?mod=space&$2=$3&$4
    24. endif
    25. match URL into $ with ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$
    26. if matched then
    27.         set URL = $1/$2.php?rewrite=$3&$4
    28. endif
    Sao chép mã


    Nginx Web Server
    1. rewrite ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
    2. rewrite ^(.*)/article-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2 last;
    3. rewrite ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
    4. rewrite ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
    5. rewrite ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
    6. rewrite ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
    7. rewrite ^(.*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last;

    Sao chép mã

    Nhớ thay thư mục discux bằng thư mục diễn đàn của bạn
    1. RewriteBase /discuz
    Sao chép mã
    Đăng lúc 14-10-2010 06:43 PM | Xem tất
    cai nay su dung vao dau day anh saokim? sao ko huong dan cu the them ti di
    Đăng lúc 14-10-2010 08:14 PM | Xem tất
    các host linux thì dùng mã cho Apache Web Server
    còn host win thì dùng IIS Web Server
    tạo file .htaccess rồi cop nội dung trên vào
    Log ACP bật mod rewrite

    Cảm ơn

    Số người tham gia 1Thanks +1 Thu lại Lý do
    simsoonline + 1

    Xem tất cả

    Đăng lúc 16-10-2010 01:59 AM | Xem tất
    nhung ma chua lam bao gio log ACP trong dau vay ban, cu the trong  muc nao na minh ga lam dang tap choi dien dan thui
  • Tâm trạng hàng ngày
    Hạnh phúc
    2-7-2025 09:43 PM
  • Đã viết: 13 ngày

    [LV.3]Spam 3

     Tác giả| Đăng lúc 16-10-2010 09:23 AM | Xem tất
    admin cp ko biết ở đâu thì chịu rồi
    nhìn lại menu khi đăng nhập bên phải đi
    Đăng lúc 16-10-2010 07:17 PM | Xem tất
    hix. anh sao kim nghi oan choem roai, em bat Seo rui nhung ma no ko chay, tich thu vao cai seo trong Trong URL tĩnh:: thi bi loi
    Bạn phải đăng nhập mới được đăng bài Đăng nhập | Đăng ký

    Quy tắc điểm

    Đóng

    Thông báoTrước /1 Sau

    Phòng tối|Lưu trữ|Diễn đàn Yên Bái 2024 Community Guidelines |

    GMT+7, 17-10-2026 07:26 AM , Processed in 0.023033 second(s), 26 queries .

    Powered by Discuz! X3.4

    © 2001-2013 Comsenz Inc.

    Trả lời nhanh Lên trên Trở lại danh sách