هاست لینوکس

آخرین بسته‌ی MyBB: نسخه‌ی 1.8.27 MyBB منتشر شد


امتیاز موضوع:
  • 4 رأی - میانگین امتیازات: 4
  • 1
  • 2
  • 3
  • 4
  • 5
تبدیل صفحات از PHP به HTML
#1
چگونه صفحات از PHP به HTML تبدیل می شوند؟


ابتدا دلیل این کار:
1- صفحات HTML نسبت به PHP در موتورهای جست و جوگر بهتر ایندکس میشوند.
2- با این امکان میتونید کاری کنید که عنوان تاپیک همان URL تاپیک باشه، این هم در SEO موثر هست!

کنترل پنل مدیریت > پیکربندی > Server and Optimization Options
قسمت Enable search engine friendly URLs را Enable کنید.
سپس محتوای فایل htaccess.txt که در پک مای بی بی هست رو در فایل .htaccess واقع در دایرکتوری اصلی فروم اضافه کنید.

نمونه کد:

کد php:
#

# MyBB "search engine friendly" URL rewrites

# - Note, for these to work with MyBB please make sure you have

#   the setting enabled in the Admin CP and you have this file

#   named .htaccess

#

<IfModule mod_rewrite.c>

    
RewriteEngine on

    RewriteRule 
^forum-([0-9]+).html forumdisplay.php?fid=$[L,QSA]

    
RewriteRule ^forum-([0-9]+)-page-([0-9]+).html forumdisplay.php?fid=$1&page=$[L,QSA]



    
RewriteRule ^thread-([0-9]+).html showthread.php?tid=$[L,QSA]

    
RewriteRule ^thread-([0-9]+)-page-([0-9]+).html showthread.php?tid=$1&page=$[L,QSA]

    
RewriteRule ^thread-([0-9]+)-lastpost.html showthread.php?tid=$1&action=lastpost [L,QSA]

    
RewriteRule ^thread-([0-9]+)-nextnewest.html showthread.php?tid=$1&action=nextnewest [L,QSA]

    
RewriteRule ^thread-([0-9]+)-nextoldest.html showthread.php?tid=$1&action=nextoldest [L,QSA]

    
RewriteRule ^thread-([0-9]+)-newpost.html showthread.php?tid=$1&action=newpost [L,QSA]

    
RewriteRule ^thread-([0-9]+)-post-([0-9]+).html showthread.php?tid=$1&pid=$[L,QSA]



    
RewriteRule ^post-([0-9]+).html showthread.php?pid=$[L,QSA]



    
RewriteRule ^announcement-([0-9]+).html announcements.php?aid=$[L,QSA]



    
RewriteRule ^user-([0-9]+).html member.php?action=profile&uid=$[L,QSA]



    
RewriteRule ^calendar-([0-9]+).html calendar.php?calendar=$[L,QSA]

    
RewriteRule ^calendar-([0-9]+)-year-([0-9]+).html calendar.php?action=yearview&calendar=$1&year=$[L,QSA]

    
RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+).html calendar.php?calendar=$1&year=$2&month=$[L,QSA]

    
RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+).html calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$[L,QSA]

    
RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+).html calendar.php?action=weekview&calendar=$1&week=$[L,QSA]



    
RewriteRule ^event-([0-9]+).html calendar.php?action=event&eid=$[L,QSA

منبع: MS > GreyWolf & ojooobe


مردان بزرگ اراده می‌کنند و مردان کوچک آرزو
[تصویر:  1348752239.gif]




اگر روزی دشمن پیدا کردی، بدان که در رسیدن به هدفت موفق بودی.
اگر روزی تهدیدت کردند، بدان در برابرت ناتوانند.
اگر روزی خیانت دیدی، بدان قیمتت بالاست.
اگر روزی ترکت کردند، بدان با تو بودن لیاقت می‌خواهد.

 سپاس شده توسطIRBB (۱۳۸۸/۶/۲۶، ۱۳:۰۷:۴۱ عصر) ، SUPPORT (۱۳۸۸/۷/۲۷، ۱۵:۵۸:۱۸ عصر) ، ires (۱۳۸۸/۱۰/۲۹، ۱۰:۵۴:۰۷ صبح) ، Daryush (۱۳۸۸/۱۱/۱۶، ۲۰:۴۴:۵۳ عصر) ، Mobile (۱۳۸۸/۱۲/۴، ۱۹:۱۰:۲۶ عصر) ، ZEUS (۱۳۸۸/۱۲/۶، ۱۱:۱۰:۱۲ صبح) ، hamid18 (۱۳۸۹/۱/۹، ۰۲:۲۹:۲۹ صبح) ، ZUNKED (۱۳۸۹/۳/۲۱، ۱۱:۱۰:۳۴ صبح) ، Mt edition (۱۳۸۹/۱۱/۵، ۱۷:۱۱:۴۴ عصر) ، CyberGod (۱۳۸۹/۱۱/۶، ۲۰:۳۴:۲۰ عصر) ، davaran (۱۳۸۹/۱۲/۱۴، ۰۲:۴۹:۵۸ صبح) ، MAJID-SPORT (۱۳۹۰/۲/۶، ۱۸:۲۷:۳۶ عصر) ، ahmadb (۱۳۹۰/۲/۶، ۱۹:۴۶:۲۱ عصر) ، arix (۱۳۹۰/۲/۸، ۰۱:۳۱:۳۱ صبح) ، K@Z3M (۱۳۹۰/۶/۱۰، ۲۱:۱۹:۳۵ عصر) ، pdistb.ir (۱۳۹۰/۱۱/۷، ۲۲:۴۵:۳۵ عصر) ، yaser0421 (۱۳۹۰/۱۲/۱۵، ۱۱:۴۳:۴۸ صبح) ، Hamedi (۱۳۹۱/۱/۹، ۱۰:۳۳:۵۹ صبح) ، haika (۱۳۹۱/۲/۶، ۱۲:۰۴:۰۹ عصر) ، snap (۱۳۹۱/۲/۲۶، ۰۷:۵۶:۴۲ صبح) ، Mdl (۱۳۹۱/۲/۳۱، ۱۴:۵۵:۱۴ عصر) ، geo (۱۳۹۱/۳/۳، ۰۳:۰۱:۴۷ صبح) ، soltaneghalbha (۱۳۹۱/۳/۱۰، ۱۱:۱۶:۴۹ صبح) ، زودگذر (۱۳۹۱/۳/۲۰، ۲۱:۱۱:۳۳ عصر) ، Doodoo (۱۳۹۱/۳/۲۶، ۱۳:۰۵:۲۰ عصر) ، Mohammad-Mo (۱۳۹۱/۶/۲۵، ۰۸:۳۷:۴۲ صبح) ، captaintsubasa (۱۳۹۱/۶/۲۷، ۱۰:۰۳:۳۴ صبح) ، Iraj Mirza (۱۳۹۱/۱۰/۱۱، ۲۰:۵۰:۱۰ عصر) ، farzinafn (۱۳۹۳/۴/۲۱، ۲۳:۵۵:۱۳ عصر) ، firstboy000 (۱۳۹۳/۱۱/۱۷، ۰۹:۴۵:۵۳ صبح) ، ali_joon (۱۳۹۵/۳/۱۳، ۲۱:۵۴:۵۱ عصر) ، mrghaedi (۱۳۹۶/۱/۷، ۰۲:۱۴:۱۱ صبح) ، Mohammad-Za (۱۳۹۶/۳/۱۸، ۱۸:۰۰:۲۸ عصر)
#2
نقل‌قول: سپس محتوای فایل htaccess.txt که در پک مای بی بی هست رو در فایل .htaccess واقع در دایرکتوری اصلی فروم اضافه کنید.
من متوجه این جمله تون نمی شم ؛ هم در پک مای بی بی و هم در دایرکتوری فروم فقط همین فایل htaccess.txt وجود داره
این قسمت نارنجی از کجا اومد ؟
فرومم شیلتر شد ! ولی مث مرد جلوشون واسادم !
چند روز دیگه با ظاهر جدید افتتاح می شه ، لینک می زارم .Cool
 سپاس شده توسطhaji (۱۳۸۹/۴/۱۱، ۰۱:۳۸:۲۶ صبح) ، captaintsubasa (۱۳۹۱/۶/۲۷، ۱۰:۰۳:۲۶ صبح)
#3
دوستان میشه بیشتر توضیح بدید...

من کدهای پست اول رو به فایل htaccess که توی دامنه اصلی مای بی بی است گذاشتم (توی forums.serialnama.com)

و اون گزینه رو هم Enable کردم ولی بازم لینک ها طولانی هستن!

چیکار باید بکنم؟
[تصویر:  84t99shicmcvx5f7yh6.png]
#4
طولانی بودن لینک ها به دلیل نصب Googleseo استWink
 سپاس شده توسطPars (۱۳۸۹/۴/۲۴، ۲۰:۳۴:۵۹ عصر) ، K@M@L (۱۳۸۹/۴/۲۴، ۲۲:۴۴:۵۲ عصر) ، mrghaedi (۱۳۹۶/۱/۷، ۰۲:۱۷:۳۸ صبح)
#5
سلام و درود به همه مدیران عزیز
من کاری رو که گفتیتد انجام دادم ولی مشکلی دارم بعد از انجام کار لینک ها درست میشه ولی وقتی روش کلیک میکنم میگه چنین صفحه ای وجود نداره
کد:
The requested URL /thread-29-lastpost.html was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2 Server at forum.cmsnews.ir Port 80

لینک قبل از تنظیمات این بوده showthread.php?tid=29 ولی حالا شده این thread-29-lastpost.html همچی درسته ولی صفحه باز نمیشه ؟
ممنون میشم راهنمایی کنید
#6
(۱۳۸۹/۴/۲۵، ۰۰:۰۲:۱۸ صبح)tarrahan نوشته است: سلام و درود به همه مدیران عزیز
من کاری رو که گفتیتد انجام دادم ولی مشکلی دارم بعد از انجام کار لینک ها درست میشه ولی وقتی روش کلیک میکنم میگه چنین صفحه ای وجود نداره
کد:
The requested URL /thread-29-lastpost.html was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2 Server at forum.cmsnews.ir Port 80

لینک قبل از تنظیمات این بوده showthread.php?tid=29 ولی حالا شده این thread-29-lastpost.html همچی درسته ولی صفحه باز نمیشه ؟
ممنون میشم راهنمایی کنید
مشکل باید مربوط به .htaccess باشد.


مردان بزرگ اراده می‌کنند و مردان کوچک آرزو
[تصویر:  1348752239.gif]




اگر روزی دشمن پیدا کردی، بدان که در رسیدن به هدفت موفق بودی.
اگر روزی تهدیدت کردند، بدان در برابرت ناتوانند.
اگر روزی خیانت دیدی، بدان قیمتت بالاست.
اگر روزی ترکت کردند، بدان با تو بودن لیاقت می‌خواهد.

 سپاس شده توسطreza_ (۱۳۹۰/۵/۲۳، ۲۳:۲۱:۴۰ عصر) ، geo (۱۳۹۱/۳/۳، ۰۱:۳۸:۴۸ صبح) ، mrghaedi (۱۳۹۶/۱/۷، ۰۲:۱۷:۴۸ صبح)
#7
فایل خودتون رو اینجا پیوست میکنید
دوستان میتونند فایل پیوست رو آپلود کنند و استفاده کنند به جای ساختن فایل کدهای زیر
کد:
#

# MyBB "search engine friendly" URL rewrites
# - Note, for these to work with MyBB please make sure you have
#   the setting enabled in the Admin CP and you have this file
#   named .htaccess

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^forum-([0-9]+).html forumdisplay.php?fid=$1 [L,QSA]
    RewriteRule ^forum-([0-9]+)-page-([0-9]+).html forumdisplay.php?fid=$1&page=$2 [L,QSA]


    RewriteRule ^thread-([0-9]+).html showthread.php?tid=$1 [L,QSA]

    RewriteRule ^thread-([0-9]+)-page-([0-9]+).html showthread.php?tid=$1&page=$2 [L,QSA]

    RewriteRule ^thread-([0-9]+)-lastpost.html showthread.php?tid=$1&action=lastpost [L,QSA]

    RewriteRule ^thread-([0-9]+)-nextnewest.html showthread.php?tid=$1&action=nextnewest [L,QSA]

    RewriteRule ^thread-([0-9]+)-nextoldest.html showthread.php?tid=$1&action=nextoldest [L,QSA]

    RewriteRule ^thread-([0-9]+)-newpost.html showthread.php?tid=$1&action=newpost [L,QSA]

    RewriteRule ^thread-([0-9]+)-post-([0-9]+).html showthread.php?tid=$1&pid=$2 [L,QSA]



    RewriteRule ^post-([0-9]+).html showthread.php?pid=$1 [L,QSA]



    RewriteRule ^announcement-([0-9]+).html announcements.php?aid=$1 [L,QSA]



    RewriteRule ^user-([0-9]+).html member.php?action=profile&uid=$1 [L,QSA]



    RewriteRule ^calendar-([0-9]+).html calendar.php?calendar=$1 [L,QSA]

    RewriteRule ^calendar-([0-9]+)-year-([0-9]+).html calendar.php?action=yearview&calendar=$1&year=$2 [L,QSA]

    RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+).html calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]

    RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+).html calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4 [L,QSA]

    RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+).html calendar.php?action=weekview&calendar=$1&week=$2 [L,QSA]



    RewriteRule ^event-([0-9]+).html calendar.php?action=event&eid=$1 [L,QSA]


فایل‌(های) پیوست شده
.zip   HTML.zip (اندازه: 601 bytes / تعداد دفعات دریافت: 291)
 سپاس شده توسطswastika (۱۳۸۹/۷/۲۹، ۲۱:۳۶:۴۰ عصر) ، arash_fa (۱۳۹۰/۱/۲۵، ۰۳:۵۶:۵۱ صبح) ، Cancer9003 (۱۳۹۰/۲/۶، ۱۴:۲۸:۱۸ عصر) ، رضا (۱۳۹۰/۱۱/۲۸، ۰۲:۲۳:۳۴ صبح) ، s2s2x (۱۳۹۰/۱۲/۲۰، ۰۴:۲۴:۵۵ صبح) ، godonly (۱۳۹۱/۱/۳۰، ۰۰:۱۶:۴۰ صبح) ، زودگذر (۱۳۹۱/۳/۲۰، ۲۱:۱۲:۳۹ عصر) ، Iraj Mirza (۱۳۹۱/۱۰/۱۱، ۲۰:۵۰:۰۳ عصر) ، number-one (۱۳۹۲/۵/۱۶، ۱۸:۰۴:۵۴ عصر) ، fariddarabi (۱۳۹۲/۹/۱۴، ۱۸:۲۵:۴۲ عصر)
#8
دوستایی که مشکل دارن
به نظر من که این کد کاملتره بعد از انجام مرحله اول محتویات .htaccess رو پاک کنید و این کد رو کپی کنید:
کد:
Options -MultiViews +FollowSymlinks -Indexes

#
# If mod_security is enabled, attempt to disable it.
# - Note, this will work on the majority of hosts but on
#   MediaTemple, it is known to cause random Internal Server
#   errors. For MediaTemple, please remove the block below
#
<IfModule mod_security.c>
    # Turn off mod_security filtering.
    SecFilterEngine Off

    # The below probably isn't needed, but better safe than sorry.
    SecFilterScanPOST Off
</IfModule>

#
# MyBB "search engine friendly" URL rewrites
# - Note, for these to work with MyBB please make sure you have
#   the setting enabled in the Admin CP and you have this file
#   named .htaccess
#
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^forum-([0-9]+)\.html$ forumdisplay.php?fid=$1 [L,QSA]
    RewriteRule ^forum-([0-9]+)-page-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2 [L,QSA]

    RewriteRule ^thread-([0-9]+)\.html$ showthread.php?tid=$1 [L,QSA]
    RewriteRule ^thread-([0-9]+)-page-([0-9]+)\.html$ showthread.php?tid=$1&page=$2 [L,QSA]
    RewriteRule ^thread-([0-9]+)-lastpost\.html$ showthread.php?tid=$1&action=lastpost [L,QSA]
    RewriteRule ^thread-([0-9]+)-nextnewest\.html$ showthread.php?tid=$1&action=nextnewest [L,QSA]
    RewriteRule ^thread-([0-9]+)-nextoldest\.html$ showthread.php?tid=$1&action=nextoldest [L,QSA]
    RewriteRule ^thread-([0-9]+)-newpost\.html$ showthread.php?tid=$1&action=newpost [L,QSA]
    RewriteRule ^thread-([0-9]+)-post-([0-9]+)\.html$ showthread.php?tid=$1&pid=$2 [L,QSA]

    RewriteRule ^post-([0-9]+)\.html$ showthread.php?pid=$1 [L,QSA]

    RewriteRule ^announcement-([0-9]+)\.html$ announcements.php?aid=$1 [L,QSA]

    RewriteRule ^user-([0-9]+)\.html$ member.php?action=profile&uid=$1 [L,QSA]

    RewriteRule ^calendar-([0-9]+)\.html$ calendar.php?calendar=$1 [L,QSA]
    RewriteRule ^calendar-([0-9]+)-year-([0-9]+)\.html$ calendar.php?action=yearview&calendar=$1&year=$2 [L,QSA]
    RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$ calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]
    RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+)\.html$ calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4 [L,QSA]
    RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+)\.html$ calendar.php?action=weekview&calendar=$1&week=$2 [L,QSA]

    RewriteRule ^event-([0-9]+)\.html$ calendar.php?action=event&eid=$1 [L,QSA]

    <IfModule mod_env.c>
        SetEnv SEO_SUPPORT 1
    </IfModule>
</IfModule>

#
# If Apache is compiled with built in mod_deflade/GZIP support
# then GZIP Javascript, CSS, HTML and XML so they're sent to
# the client faster.
#
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE application/x-javascript text/css text/html text/xml
</IfModule>
تکنیک برتر از July 2010 عضو مرجع فارسی MyBB می باشد.
 سپاس شده توسطmehotkhan (۱۳۸۹/۵/۲۷، ۱۵:۵۲:۰۴ عصر) ، hosebr (۱۳۹۰/۸/۱، ۰۲:۳۵:۳۰ صبح) ، jamali (۱۳۹۰/۹/۱۷، ۰۹:۲۷:۵۸ صبح) ، pdistb.ir (۱۳۹۰/۱۱/۷، ۲۲:۴۵:۲۹ عصر) ، s2s2x (۱۳۹۱/۲/۲، ۱۳:۲۴:۱۱ عصر) ، arz (۱۳۹۱/۶/۲۵، ۰۹:۰۷:۲۲ صبح) ، Iraj Mirza (۱۳۹۱/۱۰/۱۱، ۲۰:۵۰:۰۰ عصر)
#9
درود
وقتی که این کار رو انجام دادیم , آدرس های قبلی به آدرس جدید منتقل میشود ؟ به عبارت دیگه آیا انجام این کار نیاز به ایندکس شدن دوباره دارد ؟ و انجمن در هر شرایطی که استفاده کند , مفید هست ؟ ( مثلا با گذشت 2 سال از عمر انجمن )

[تصویر:  a368b364f24d0b1337d2e69b336d3dd5.png]
www.MyGeneral.ir
#10
همواره مفید است.


مردان بزرگ اراده می‌کنند و مردان کوچک آرزو
[تصویر:  1348752239.gif]




اگر روزی دشمن پیدا کردی، بدان که در رسیدن به هدفت موفق بودی.
اگر روزی تهدیدت کردند، بدان در برابرت ناتوانند.
اگر روزی خیانت دیدی، بدان قیمتت بالاست.
اگر روزی ترکت کردند، بدان با تو بودن لیاقت می‌خواهد.

 سپاس شده توسطMt edition (۱۳۹۰/۱/۲۷، ۱۴:۴۱:۴۱ عصر) ، umzst (۱۳۹۰/۵/۱۸، ۲۰:۲۰:۵۳ عصر) ، yaser0421 (۱۳۹۰/۱۲/۹، ۱۰:۰۶:۰۳ صبح) ، number-one (۱۳۹۲/۵/۱۶، ۱۸:۰۵:۴۳ عصر) ، M.nestor (۱۳۹۳/۳/۷، ۱۴:۰۰:۳۸ عصر)


پرش به انجمن:


کاربرانِ درحال بازدید از این موضوع: 1 مهمان