بسم الله الرحمن الرحيم
مثال على ذلك :
[ فقط المشتركين فى المنتدى يمكنهم رؤية الرابط . اضعط هنا للتسجيل ... ]
[ فقط المشتركين فى المنتدى يمكنهم رؤية الرابط . اضعط هنا للتسجيل ... ]
[ فقط المشتركين فى المنتدى يمكنهم رؤية الرابط . اضعط هنا للتسجيل ... ]
[ فقط المشتركين فى المنتدى يمكنهم رؤية الرابط . اضعط هنا للتسجيل ... ]
الطريقة :
1. افتح ملف جديد بالمفكرة واضف اليه :
كود PHP:
RewriteEngine On
RewriteBase /
#Sections
RewriteRule ^Sections.html modules.php?name=Sections
RewriteRule ^Sections_article([0-9]+).html$ modules.php?name=Sections&op=viewarticle&artid=$1
RewriteRule ^Sections_category([0-9]+).html$ modules.php?name=Sections&op=listarticles&secid=$1
#Articles
RewriteRule ^article-([0-9]*)-([a-z]*)-([0-9]*)-([0-9]*).html modules.php?name=News&file=article&sid=$1&mode=$2& order=$3&thold=$4
RewriteRule ^article([1-9][0-9]*).* modules.php?name=News&file=article&sid=$1
RewriteRule ^article-topic-([0-9]*).html modules.php?name=News&new_topic=$1
RewriteRule ^allnews.html modules.php?name=News&file=allindex
#Your Account
RewriteRule ^userinfo-([a-zA-Z0-9_-]*).html modules.php?name=Your_Account&op=userinfo&username =$1
#Topics
RewriteRule ^topics.html modules.php?name=Topics
#Downloads
RewriteRule ^downloads-cat-([0-9]*).html modules.php?name=Downloads&cid=$1
RewriteRule ^downloads-getit-([0-9]*).html modules.php?name=Downloads&op=getit&lid=$1
RewriteRule ^downloads-modify-([0-9]*).html modules.php?name=Downloads&op=modifydownloadreques t&lid=$1
RewriteRule ^downloads-order-([0-9]*)-(titleA|titleD).html modules.php?name=Downloads&cid=$1&orderby=$2
RewriteRule ^downloads-new.html modules.php?name=Downloads&op=NewDownloads
RewriteRule ^downloads-pop.html modules.php?name=Downloads&op=MostPopular
RewriteRule ^downloads-new-days-(7|14|30).html modules.php?name=Downloads&op=NewDownloads&newdown loadshowdays=$1
RewriteRule ^downloads-new-date-([0-9]*).html modules.php?name=Downloads&op=NewDownloadsDate&sel ectdate=$1
RewriteRule ^downloads-pop-(1|5|10|25|50)-(num|percent).html modules.php?name=Downloads&op=MostPopular&ratenum= $1&ratetype=$2
RewriteRule ^downloads.html modules.php?name=Downloads
RewriteRule ^downloads-gfx-([0-9]*).html modules.php?name=Downloads&op=gfx&random_num=$1
وسمية .htaccess وارفعه للمجلد الرئيسيه للمجلة
2. افتح ملف header.php
وابحث عن
كود PHP:
if (stristr($_SERVER['******_NAME'], "header.php")) {
Header("Location: index.php");
die();
}
واضف تحته مباشرتا ً
كود PHP:
//php2html MemHT.com Mod Rewrite - START
ob_start();
function replace_for_mod_rewrite(&$s) {
$urlin = array(
"'(?<!/)modules.php\?name=News&file=article&sid=([0-9]*)&mode=([a-z]*)&order=([0-9]*)&thold=([0-9]*)'",
"'(?<!/)modules.php\?name=News&file=article&sid=([0-9]*)'",
"'(?<!/)modules.php\?name=News&file=article&sid=([0-9]*)'",
"'(?<!/)modules.php\?name=News&new_topic=([0-9]*)'",
"'(?<!/)modules.php\?name=Forums&file=viewforum&f=([0-9]+)&topicdays=([0-9]+)&start=([0-9]+)'",
"'(?<!/)modules.php\?name=Forums&file=viewforum&f=([0-9]*)&(mark|start)=([a-zA-Z0-9_]*)'",
"'(?<!/)modules.php\?name=Forums&file=viewforum&f=([0-9]*)'",
"'(?<!/)modules.php\?name=Forums&file=viewtopic&t=([0-9]+)&start=([0-9]+)&postdays=([0-9]+)&postorder=asc&highlight='",
"'(?<!/)modules.php\?name=Forums&file=viewtopic&t=([0-9]+)&postdays=([0-9]+)&postorder=asc&start=([0-9]+)'",
"'(?<!/)modules.php\?name=Forums&file=viewtopic&t=([0-9]*)&(start|view|highlight)=([/:\-\'(){}.&=_a-zA-Z0-9 ]*)'",
"'(?<!/)modules.php\?name=Forums&file=viewtopic&t=([0-9]*)&([a-zA-Z0-9]*)=topic&start=0'",
"'(?<!/)modules.php\?name=Forums&file=viewtopic&(p|t)=([0-9]*)'",
"'(?<!/)modules.php\?name=Forums&file=profile&mode=regist er&agreed=true&coppa=([a-zA-Z0-9_]*)'",
"'(?<!/)modules.php\?name=Forums&file=profile&mode=regist er&agreed=([a-zA-Z0-9_]*)'",
"'(?<!/)modules.php\?name=Forums&file=modcp&mode=([a-zA-Z0-9_]*)&p=([0-9_&]*)&t=([a-zA-Z0-9_&=\.\;]*)'",
"'(?<!/)modules.php\?name=Forums&file=modcp&t=([0-9]*)&mode=([a-zA-Z0-9]*)'",
"'(?<!/)modules.php\?name=Forums&file=([a-zA-Z0-9_]*)&mode=([a-zA-Z0-9_]*)&t=([0-9]*)&popup=([0-9]*)'",
"'(?<!/)modules.php\?name=Forums&file=([a-zA-Z0-9_]*)&mode=([a-zA-Z0-9_]*)&(p|t|f|u|popup)=([0-9]*)'",
"'(?<!/)modules.php\?name=Forums&file=([a-zA-Z0-9_]*)&mode=([a-zA-Z0-9_]*)&(p|t|f|u|popup)=([0-9]*)'",
"'(?<!/)modules.php\?name=Forums&file=([a-zA-Z0-9_]*)&mode=([a-zA-Z0-9_]*)&(p|t|f|u|popup)=([0-9]*)'",
"'(?<!/)modules.php\?name=Forums&file=([a-zA-Z0-9_]*)&mode=([a-zA-Z0-9_]*)'",
"'(?<!/)modules.php\?name=Forums&file=search&([a-zA-Z0-9_]*)=([a-zA-Z0-9_]*)&([a-zA-Z0-9_]*)=([a-zA-Z0-9_]*)'",
"'(?<!/)modules.php\?name=Forums&file=([a-zA-Z0-9_]*)&([a-zA-Z0-9_]*)=([a-zA-Z0-9_]*)'",
"'(?<!/)modules.php\?name=Forums&file=([a-zA-Z0-9_]*)'",
"'(?<!/)modules.php\?name=Forums'",
"'(?<!/)modules.php\?name=Your_Account&op=userinfo&userna me=([a-zA-Z0-9_-]*)'",
"'(?<!/)modules.php\?name=Your_Account&op=userinfo&am p;username=([a-zA-Z0-9_-]*)'",
"'(?<!/)modules.php\?name=Downloads&cid=([0-9]*)&orderby=(titleA|titleD)'",
"'(?<!/)modules.php\?name=Downloads&cid=([0-9]*)'",
"'(?<!/)modules.php\?name=Downloads&op=getit&lid= ([0-9]*)'",
"'(?<!/)modules.php\?name=Downloads&op=modifydownload request&lid=([0-9]*)'",
"'(?<!/)modules.php\?name=Downloads&op=NewDownloads&a mp;newdownloadshowdays=(7|14|30)'",
"'(?<!/)modules.php\?name=Downloads&op=NewDownloadsDa te&selectdate=([0-9]*)'",
"'(?<!/)modules.php\?name=Downloads&op=MostPopular&am p;ratenum=(1|5|10|25|50)&ratetype=(num|percent )'",
"'(?<!/)modules.php\?name=Downloads&op=NewDownloads'" ,
"'(?<!/)modules.php\?name=Downloads&op=MostPopular'",
"'(?<!/)modules.php\?name=Downloads'",
"'(?<!/)modules.php\?name=Topics'",
"'(?<!/)modules.php\?name=Downloads&op=gfx&random_num=([0-9]*)'",
);
$urlout = array(
"article-\\1-\\2-\\3-\\4.html",
"article\\1.html",
"article\\1.html",
"article-topic-\\1.html",
"forumx\\1-\\2-\\3.html",
"forum\\1-\\2\\3.html",
"forum\\1.html",
"postx\\1-\\2-\\3.html",
"postxf\\1-\\2-\\3.html",
"posts\\1-\\2\\3.html",
"topic\\1-\\2.html",
"post\\1\\2.html",
"register-coppa-\\1.html",
"register-\\1.html",
"poster\\1-\\2_\\3.html",
"modcp\\1-\\2.html",
"forums-\\1-\\2-\\3-\\4.html",
"forums-\\1-\\2-\\3-\\4.html",
"forums-\\1-\\2-\\3-\\4.html",
"forums-\\1-\\2-\\3-\\4.html",
"forums-\\1-\\2.html",
"forum\\1-\\2-\\3-\\4.html",
"forums\\1-\\2-\\3.html",
"forum-\\1.html",
"forums.html",
"userinfo-\\1.html",
"userinfo-\\1.html",
"downloads-order-\\1-\\2.html",
"downloads-cat-\\1.html",
"downloads-getit-\\1.html",
"downloads-modify-\\1.html",
"downloads-new-days-\\1.html",
"downloads-new-date-\\1.html",
"downloads-pop-\\1-\\2.html",
"downloads-new.html",
"downloads-pop.html",
"downloads.html",
"topics.html",
"downloads-gfx-\\1.html",
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
//php2html MemHT.com Mod Rewrite - END
احفظ التعديل ومن ثم ارفع الملف لمكانه
3. افتح ملف footer.php وابحث عن
كود PHP:
foot();
واضف بعده مباشره
كود PHP:
//php2html MemHT.com Mod Rewrite - START
$*******s = ob_get_*******s();
ob_end_clean();
echo replace_for_mod_rewrite($*******s);
//php2html MemHT.com Mod Rewrite - END
احفظ التعديل ومن ثم ارفع الملف لمكانه
بعد هذا روح عدل على روابط المودلزات
مثال : افتح ملف index.php الخاص بـ Sections
وابحث عن
modules.php?name=$module_name&op=listarticles& amp;secid=$secid
واستبدل الروابط ب
Sections_category$secid.html
ومن ثم ابحث بنفس الملف عن
modules.php?name=$module_name&op=viewarticle&a mp;artid=$artid
استبدل الروابط ب
Sections_article$artid.html
وبكده يمكن الدخول بالرابط الجديد
[ فقط المشتركين فى المنتدى يمكنهم رؤية الرابط . اضعط هنا للتسجيل ... ]
اتمنى الدعاء لي ولوالدي ولجميع المسلمين