ÎÞÂÛÄãÍøվȫվÊǾ²Ì¬»òÕ߶¯Ì¬»¹ÊÇα¾²Ì¬£¬´Ë½Ì³Ì¶¼¿ÉÒÔÉèÖÃTAG±êǩҳΪα¾²Ì¬£¬²¢ÇÒÊǵ¥Á´½Óºº×ÖÃû³ÆµÄÐÎʽ
°´´Ë½Ì³Ì²Ù×÷ºó£¬µçÄÔÕ¾TAG±êÇ©url»áÏñÈçÏ£º
TAG±êÇ©Ê×Ò³ https://www.dede58.com/tags.html
TAG±êÇ©Áбí https://www.dede58.com/tags/Ö¯ÃÎ.html
TAG±êÇ©·ÖÒ³ https://www.dede58.com/tags/Ö¯ÃÎ_2.html
°´´Ë½Ì³Ì²Ù×÷ºó£¬ÊÖ»úÕ¾TAG±êÇ©url»áÏñÈçÏ£º
TAG±êÇ©Ê×Ò³ https://m.dede58.com/tags.html
TAG±êÇ©Áбí https://m.dede58.com/tags/Ö¯ÃÎ.html
TAG±êÇ©·ÖÒ³ https://m.dede58.com/tags/Ö¯ÃÎ_2.html
µçÄÔÕ¾TAGα¾²Ì¬ÊµÏֽ̳Ì
1¡¢/tags.php ÕÒµ½ 18ÐÐ
if(isset($tags[2])) $PageNo = intval($tags[2]);
ÔÚËüÏÂÃæ¼ÓÈë
define('DEDERETAG', 'Y');
2¡¢/include/taglib/tag.lib.php ÕÒµ½ 87ÐÐ
$row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";
¸Ä³É
$row['link'] = $cfg_cmsurl."/tags/".urlencode($row['keyword']).".html";
3¡¢/include/arc.taglist.class.php ÕÒµ½ 458ÐÐ
$purl .= "?/".urlencode($this->Tag);
¸Ä³É
if(!defined('DEDERETAG')) { $purl .= "?/".urlencode($this->Tag); } else { $purl = $GLOBALS['cfg_cmsurl']."/tags/".urlencode($this->Tag).".html"; } |
¼ÌÐøÕÒµ½
return $plist;
ÔÚËüÉÏÃæ¼ÓÈë
if(defined('DEDERETAG')) { $plist = preg_replace('/_(d+).html/i','.html',$plist); $plist = preg_replace('/.html/(d+)//i','_.html',$plist); } |
4¡¢µçÄÔÕ¾TAG±êǩα¾²Ì¬¹æÔò£¬¸ù¾Ý×Ô¼ºÍøÕ¾µÄÖ÷»ú»·¾³Ñ¡ÔñÏÂÃæµÄ¹æÔò
.htaccess (Apache)
RewriteEngine On RewriteBase / RewriteRule ^tags.html$tags.php RewriteRule ^tags/(.*)_([0-9]+).html$tags.php?/$1/$2 RewriteRule ^tags/(.*)_([0-9]+).html$tags.php?/$1/$2/ RewriteRule ^tags/(.*).html$tags.php?/$1 [L] RewriteRule ^tags/(.*).html$tags.php?/$1/ |
Nginx
rewrite "^/tags.html$"/tags.php; rewrite "^/tags/(.*)_([0-9]+).html$"/tags.php?/$1/$2/ last; rewrite "^/tags/(.*).html$"/tags.php?/$1/; |
web.config (iis7 iis8)
<rule name="tagÊ×Ò³"> <match url="^tags.html$" ignoreCase="false" /> <action type="Rewrite" url="tags.php" appendQueryString="false" /> </rule> <rule name="tagÁбí·ÖÒ³"> <match url="^tags/(.*)_([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}" appendQueryString="false" /> </rule> <rule name="tagÁбí·ÖÒ³×îºóÓÐ×óб¸Ü"> <match url="^tags/(.*)_([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}/" appendQueryString="false" /> </rule> <rule name="tagÁбí"> <match url="^tags/(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}" appendQueryString="false" /> </rule> <rule name="tagÁбí×îºóÓÐ×óб¸Ü"> <match url="^tags/(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}/" appendQueryString="false" /> </rule> |
ÈçÐèºǫ́TAG±êÇ©¹ÜÀíÀïµÄTAGÁ´½Óµã»÷´ò¿ªÒ²ÊÇα¾²Ì¬¿ÉÕâÑù¸Ä
(´ËͼƬÀ´Ô´ÓÚÍøÂ磬ÈçÓÐÇÖȨ£¬ÇëÁªÏµÉ¾³ý! )
´ò¿ª /dede/templets/tags_main.htm ÕÒµ½ 89ÐÐ
<a href="../tags.php?/<?php echo urlencode($fields['tag']); ?>/" target="_blank">{dede:field.tag /}</a>
¸Ä³É
<a href="../tags/<?php echo urlencode($fields['tag']); ?>.html" target="_blank">{dede:field.tag /}</a>
ÊÖ»úÕ¾TAGα¾²Ì¬ÊµÏֽ̳Ì
1¡¢m Îļþ¼ÐÌí¼Ótags.phpÎļþ¸øÊÖ»úվʹÓÃ
¸½ÏÂÔصØÖ·£º
(´ËͼƬÀ´Ô´ÓÚÍøÂ磬ÈçÓÐÇÖȨ£¬ÇëÁªÏµÉ¾³ý! ) |
Ö¯ÃÎÊÖ»úÕ¾TAG±êǩα¾²Ì¬-Ìí¼Ótags.phpÎļþ.zip |
2¡¢ÊÖ»úÕ¾TAG±êǩα¾²Ì¬¹æÔò£¬¸ù¾Ý×Ô¼ºÍøÕ¾µÄÖ÷»ú»·¾³Ñ¡ÔñÏÂÃæµÄ¹æÔò
.htaccess (Apache ·Åµ½mÎļþ¼ÐÏÂ)
RewriteEngine On RewriteBase / RewriteRule ^tags.html$tags.php RewriteRule ^tags/(.*)_([0-9]+).html$tags.php?/$1/$2 RewriteRule ^tags/(.*)_([0-9]+).html$tags.php?/$1/$2/ RewriteRule ^tags/(.*).html$tags.php?/$1 [L] RewriteRule ^tags/(.*).html$tags.php?/$1/ |
Nginx
rewrite "^/tags.html$"/tags.php; rewrite "^/tags/(.*)_([0-9]+).html$"/tags.php?/$1/$2/ last; rewrite "^/tags/(.*).html$"/tags.php?/$1/; |
web.config (iis7 iis8)
<rule name="tagÊ×Ò³"> <match url="^tags.html$" ignoreCase="false" /> <action type="Rewrite" url="tags.php" appendQueryString="false" /> </rule> <rule name="tagÁбí·ÖÒ³"> <match url="^tags/(.*)_([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}" appendQueryString="false" /> </rule> <rule name="tagÁбí·ÖÒ³×îºóÓÐ×óб¸Ü"> <match url="^tags/(.*)_([0-9]+).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}/" appendQueryString="false" /> </rule> <rule name="tagÁбí"> <match url="^tags/(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}" appendQueryString="false" /> </rule> <rule name="tagÁбí×îºóÓÐ×óб¸Ü"> <match url="^tags/(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}/" appendQueryString="false" /> </rule> |
3¡¢ÊÖ»úÕ¾TAG±êÇ©Ê×Ò³ºÍTAG±êÇ©Áбíҳģ°åΪ
tag_m.htm
taglist_m.htm
4¡¢TAG±êÇ©µ÷ÓÃÓëµçÄÔÕ¾Ò»Ñù
ÃâÔðÉùÃ÷£º±¾Õ¾ËùÓÐÎÄÕºÍͼƬ¾ùÀ´×ÔÓû§·ÖÏíºÍÍøÂçÊÕ¼¯£¬ÎÄÕºÍͼƬ°æȨ¹éÔ×÷Õß¼°Ô³ö´¦ËùÓУ¬½ö¹©Ñ§Ï°Óë²Î¿¼£¬ÇëÎðÓÃÓÚÉÌÒµÓÃ;£¬Èç¹ûËðº¦ÁËÄúµÄȨÀû£¬ÇëÁªÏµÍøÕ¾¿Í·þ´¦Àí¡£