首页 > 编程学习 ( 第 2 页)

在导入MAGENTO SAMPLE数据时出现USING BTREE错误,主要原因是MYSQL不兼容问题导致。在tag与tag_relation两个表中使用了USING BTREE,但其格式不兼容导致导入失败。修改后即可正常导入了。

修改如下:

PRIMARY KEY (`tag_id`) USING BTREE,

修改为:

PRIMARY KEY `tab_id` USING BTREE(`tag_id`),

PRIMARY KEY (`tag_relation_id`) USING BTREE,

修改为

PRIMARY KEY `tag_relation_id` USING BTREE(`tag_relation_id`),

再次导入数据库则可完整导入。

PS:

错误原因:
主要是是MYSQL 5.1的一个BUG,其出现原因是mysql 5.1和mysql 5.0在处理到索引语句时有所区别。
案例:
有时导入mysql会提示如下错误: ERROR 1064 (42000) at line 486: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use   near ‘USING BTREE,   KEY `Reference_1_FK` (`RoleID`),   CONSTRAINT `FK_userinfo_RoleID’ at line 11
解决办法:
打开要导入的文件在里面搜索 BTREE 找到如下内容   KEY `columnCindex` (`columnC`) USING BTREE   修改为   KEY `columnCindex` USING BTREE (`columnC`),   然后就可以顺利通过了
总结:

出现了不兼容的情况,在Mysql 5.1中建有UNIQUE KEY 的表导出时是这个样子的“KEY `pkey` (`pkey`) USING BTREE”,

而Mysql 5.0处理的时候只能识别“KEY `pkey` USING BTREE (`pkey`)”。因此需要改一下Key的位置。

装萌的陈大猪

image

image

看他装逼的样

image

image

image

哈哈,这几张好看点,美女老婆帅哥老公

image

image

image

下面有点模糊哦!红米前照的

image

image

image

今天就到这了,大猪小猪主题会幸福的哦!小猪万岁,大猪下跪……

最近在使用中遇到这样一个问题,需要将两个文本文件放置在每个目录下作为说明文件,而目录数量成百上千,手工复制必然会累死,于是上网查找解决办法,经测试完全可以解决问题。

解决方案如下:

  1. 建立一个叫文本文件的文件夹,放置在磁盘根目录,我是放在F盘。
  2. 将需要复制的文本文件放在 F:\文本文件\中。
  3. 记事本新建一个文件,复制以下代码,粘贴。
  4.  修改该代码中两处  F:\粤语广播剧\多伦多ears 为你需要复制的目标目录。
  5. 然后点击保存。保存时注意不要存成txt文件,自己定义文件名后缀为bat,即批处理文件。
  6. 双击执行即可。
  1. @echo off    
  2. for /f “delims=” %%i in (‘dir /b/ad F:\粤语广播剧\多伦多ears ‘) do (    
  3. xcopy /s F:\文本文件\. “F:\粤语广播剧\多伦多ears\%%i\”    
  4. )   
  5. pause  

代码说明:

本段代码实现功能为批量复制F:\文本文件\目录下的所有文件到F:\粤语广播剧\多伦多ears\下的所有子目录中去。

有很多WordPress博客的固定链接中使用了文章ID,但是WordPress由于种种原因导致了文章ID不连续的问题,也经常有博友在论坛中提问要解决这个问题,但是很少能够得到他们满意的答复。WordPress 3.0 之后的版本都会有个自动草稿,每发表一篇文章就会占两个ID号,目前还没有禁用的方法。

最近在倒腾WordPress,也遇到了这个问题,最揪心的是发布一篇文章浪费好几个id,WordPress自动存了好几份草稿。

下面讲一下我最终的解决方法:

首先找到wp_confing.php文件,在文件中添加如下代码:

  1. define(‘AUTOSAVE_INTERVAL’, 36000000 ); //设置自动保存间隔,单位是秒,默认60   
  2. define(‘WP_POST_REVISIONS’, false ); //禁用文章修订功能  

有一种说法说要放在一下这段代码后面才会生效

  1. /** WordPress 目录的绝对路径。 */  
  2. if ( !defined(‘ABSPATH’) )   
  3.     define(‘ABSPATH’, dirname(__FILE__) . ‘/’);  

另外可将以下代码放置在主题function.php文件中,可以解决ID连续问题

  1. function keep_id_continuous(){   
  2.     global $wpdb;   
  3.     $lastID = $wpdb->get_var(“SELECT ID FROM $wpdb->posts WHERE post_status = ‘publish’ OR post_status = ‘draft’ OR post_status = ‘private’ OR ( post_status = ‘inherit’ AND post_type = ‘attachment’ ) ORDER BY ID DESC LIMIT 1″);   
  4.     $wpdb->query(“DELETE FROM $wpdb->posts WHERE ( post_status = ‘auto-draft’ OR ( post_status = ‘inherit’ AND post_type = ‘revision’ ) ) AND ID > $lastID”);   
  5.     $lastID++;   
  6.     $wpdb->query(“ALTER TABLE $wpdb->posts AUTO_INCREMENT = $lastID”);   
  7. }   
  8. // 将函数钩在新建文章、上传媒体和自定义菜单之前。   
  9. add_filter( ‘load-post-new.php’, ‘keep_id_continuous’ );   
  10. add_filter( ‘load-media-new.php’, ‘keep_id_continuous’ );   
  11. add_filter( ‘load-nav-menus.php’, ‘keep_id_continuous’ );   
  12. // 禁用自动保存,所以编辑长文章前请注意手动保存。   
  13. add_action( ‘admin_print_scripts’, create_function( ‘$a‘, “wp_deregister_script(‘autosave’);” ) );   
  14. // 禁用修订版本   
  15. remove_action( ‘pre_post_update’ , ‘wp_save_post_revision’ );  

下面的这一段代码参考了作者小虾的方法,原文链接http://xiaoxia.de/keep-wordpress-post-id-continuous/

windows平台虚拟主机实现伪静态(URL Rewrite)的流程:进入虚拟主机控制面板,点“ISAPI筛选器 ”,点击“开启自定义的URL静态化支持”,再修改/others/discuz/httpd.conf 在里面添加您自己的规则即可。

注意,所有规则放在一起可能会有冲突,只放置你需要的规则即可。

  1. #shopex4.8    
  2. RewriteBase /   
  3. RewriteCond %{REQUEST_FILENAME} \.(html|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|cgi|shtml|shtm|phtm|xml)$   
  4. RewriteCond %{REQUEST_FILENAME} !-f   
  5. RewriteCond %{REQUEST_FILENAME} !-d   
  6. RewriteRule ^(?!shopadmin)(.*)$ index.php?$1 [L,QSA]   
  7.   
  8. #shopex4.72  
  9. RewriteRule /index.html /index.php   
  10. RewriteRule /default.html /index.php   
  11. RewriteRule /bulletin.html /index.php?gOo=article_list.dwt&acat=1  
  12. RewriteRule /bulletin_([0-9]+).html /index.php?gOo=article_list.dwt&acat=1&p=$1  
  13. RewriteRule /catalog.html /index.php?gOo=goods_category.dwt   
  14. RewriteRule /list.html /index.php?gOo=goods_search_list.dwt   
  15. RewriteRule /list_([0-9]+).html /index.php?gOo=goods_search_list.dwt&p=$1  
  16. RewriteRule /member.html /index.php?gOo=member_home.dwt   
  17. RewriteRule /faq.html /index.php?gOo=help.dwt&acat=2  
  18. RewriteRule /faq_([0-9]+).html /index.php?gOo=help.dwt&acat=2&p=$1  
  19. RewriteRule /safe.html /index.php?gOo=help_safe.dwt   
  20. RewriteRule /howtobuy.html /index.php?gOo=help_buystep.dwt   
  21. RewriteRule /howtopay.html /index.php?gOo=help_send.dwt   
  22. RewriteRule /contactus.html /index.php?gOo=help_contact.dwt   
  23. RewriteRule /aboutus.html /index.php?gOo=help_copyright.dwt   
  24. RewriteRule /feedback.html /index.php?gOo=shopbbs.dwt   
  25. RewriteRule /feedback_([0-9]+).html /index.php?gOo=shopbbs.dwt&p=$1  
  26. RewriteRule /friendlink.html /index.php?gOo=linkmore.dwt   
  27. RewriteRule /register.html /index.php?gOo=register_1.dwt   
  28. RewriteRule /lostpass.html /index.php?gOo=forget.dwt   
  29. RewriteRule /product/([0-9]+).html /index.php?gOo=goods_details.dwt&goodsid=$1    
  30. RewriteRule /product_([0-9]+).html /index.php?gOo=goods_details.dwt&goodsid=$1    
  31. RewriteRule /([0-9]+)_([^.]*).html /index.php?gOo=goods_details.dwt&goodsid=$1    
  32. RewriteRule /article_([0-9]+).html /index.php?gOo=help_details.dwt&articleid=$1    
  33. RewriteRule /message_([0-9]+).html /index.php?gOo=article_details.dwt&articleid=$1    
  34. RewriteRule /catalog_([0-9]+).html /index.php?gOo=goods_search_list.dwt&gcat=$1    
  35. RewriteRule /catalog_([0-9]+)_([0-9]+).html /index.php?gOo=goods_search_list.dwt&gcat=$1&p=$2    
  36. RewriteRule /addtofavorites_([0-9]+).html /index.php?gOo=addmembergoods.do&goodsid=$1    
  37. RewriteRule /list_([a-zA-Z]+).html /index.php?gOo=goods_search_list.dwt&gtype=$1    
  38. RewriteRule /list_([a-zA-Z]+)_([0-9]+).html /index.php?gOo=goods_search_list.dwt&gtype=$1&p=$2  
  39.   
  40. #ecshop   
  41. RewriteRule ^(.*)/index.html$                $1/index\.php          [I]   
  42. RewriteRule ^(.*)/category$                  $1/index\.php          [I]   
  43. RewriteRule ^(.*)/feed-c([0-9]+).xml$        $1/feed\.php\?cat=$2    [I]   
  44. RewriteRule ^(.*)/feed-b([0-9]+).xml$        $1/feed\.php\?brand=$2  [I]   
  45. RewriteRule ^(.*)/feed.xml$                  $1/feed\.php           [I]   
  46. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$  $1/category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6&page=$7&sort=$8&order=$9 [I]   
  47. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)\.html$                            $1/category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6                          [I]   
  48. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$                              $1/category\.php\?id=$2&brand=$3&page=$4&sort=$5&order=$6                                          [I]   
  49. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$                                       $1/category\.php\?id=$2&brand=$3&page=$4                                                           [I]   
  50. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.html$                                            $1/category\.php\?id=$2&brand=$3                                                                   [I]   
  51. RewriteRule ^(.*)/category-([0-9]+)(.*)\.html$                               $1/category\.php\?id=$2                              [I]   
  52. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)\.html(.*)$                                            $1/category\.php\?$4&id=$2&brand=$3  
  53. RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html$                                  $1/goods\.php\?id=$2                                 [I]   
  54. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$  $1/article_cat\.php\?id=$2&page=$3&sort=$4&order=$5  [I]   
  55. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)\.html$                   $1/article_cat\.php\?id=$2&page=$3                   [I]   
  56. RewriteRule ^(.*)/article_cat-([0-9]+)(.*)\.html$                            $1/article_cat\.php\?id=$2                           [I]   
  57. RewriteRule ^(.*)/article-([0-9]+)(.*)\.html$                                $1/article\.php\?id=$2                               [I]   
  58. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html   $1/brand\.php\?id=$2&cat=$3&page=$4&sort=$5&order=$6 [I]   
  59. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html                $1/brand\.php\?id=$2&cat=$3&page=$4                  [I]   
  60. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)\.html(.*)$                        $1/brand\.php\?$4&id=$2&cat=$3                  [I]   
  61. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)\.html                         $1/brand\.php\?id=$2&cat=$3                          [I]   
  62. RewriteRule ^(.*)/brand-([0-9]+)(.*)\.html                                   $1/brand\.php\?id=$2                                 [I]   
  63. RewriteRule ^(.*)/tag-(.*)\.html                                             $1/search\.php\?keywords=$2                          [I]   
  64. RewriteRule ^(.*)/snatch-([0-9]+)\.html$                                     $1/snatch\.php\?id=$2                                [I]   
  65. RewriteRule ^(.*)/group_buy-([0-9]+)\.html$                                  $1/group_buy\.php\?act=view&id=$2                    [I]   
  66. RewriteRule ^(.*)/auction-([0-9]+)\.html$                                    $1/auction\.php\?act=view&id=$2                      [I]   
  67. RewriteRule ^(.*)/exchange-id([0-9]+)(.*)\.html$                             $1/exchange\.php\?id=$2&act=view                     [I]   
  68. RewriteRule ^(.*)/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ $1/exchange\.php\?cat_id=$2&integral_min=$3&integral_max=$4&page=$5&sort=$6&order=$7 [I]   
  69. RewriteRule ^(.*)/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$                         $1/exchange\.php\?cat_id=$2&page=$3&sort=$4&order=$5 [I]   
  70. RewriteRule ^(.*)/exchange-([0-9]+)-([0-9]+)(.*)\.html$                                          $1/exchange\.php\?cat_id=$2&page=$3  [I]   
  71. RewriteRule ^(.*)/exchange-([0-9]+)(.*)\.html$                                                   $1/exchange\.php\?cat_id=$2  [I]   
  72.   
  73. #phpwind 跟shopex4.85的规则有冲突! #是注释符号,默认没启用phpwind的规则的。   
  74. #RewriteRule ^(.*)-htm-(.*)$ $1.php?$2  
  75. #RewriteRule ^(.*)simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2  
  76.   
  77. #discuz 老版本规则   
  78. RewriteRule ^(.*)/archiver/([a-z0-9\-]+\.html)$ $1/archiver/index\.php\?$2  
  79. RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay\.php\?fid=$2&page=$3  
  80. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3  
  81. RewriteRule ^(.*)/profile-(username|uid)-(.+)\.html$ $1/viewpro\.php\?$2=$3  
  82. RewriteRule ^(.*)-htm-(.*)$ $1.php?$2  
  83. RewriteRule ^(.*)simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2  
  84. RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)\?*(.*)$ $1/archiver/index\.php\?$2&$4  
  85. RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forumdisplay\.php\?fid=$2&page=$3&$4  
  86. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3&$4  
  87. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/space\.php\?$2=$3&$4  
  88. RewriteRule ^(.*)/tag-(.+)\.html\?*(.*)$ $1/tag\.php\?name=$2&$3  
  89.   
  90. #Discuz!x和discuz x1.5伪静态规则   
  91. RewriteRule ^(.*)/topic-(.+)\.html\?*(.*)$ $1/portal\.php\?mod=topic&topic=$2&$3  
  92. RewriteRule ^(.*)/article-([0-9]+)\.html\?*(.*)$ $1/portal\.php\?mod=article&articleid=$2&$3  
  93. RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$4  
  94. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$5  
  95. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=group&fid=$2&page=$3&$4  
  96. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/home\.php\?mod=space&$2=$3&$4  
  97. RewriteRule ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$ $1/$2\.php\?rewrite=$3&$4  
  98.   
  99. #discuz——-supsite/x-space   
  100. RewriteRule ^(.*)/archiver/([a-z0-9\-]+\.html)$ $1/archiver/index\.php\?$2  
  101. RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay\.php\?fid=$2&page=$3  
  102. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3  
  103. RewriteRule ^(.*)/profile-(username|uid)-(.+)\.html$ $1/viewpro\.php\?$2=$3  
  104. RewriteRule ^(.*)-htm-(.*)$ $1.php?$2  
  105. RewriteRule ^(.*)simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2  
  106.   
  107.     
  108.   
  109. #Start dznt URL Rewrite (discuz NT)   
  110.   
  111.     RewriteRule ^(.*)/userinfo-([0-9]+)\.html$  $1/userinfo.aspx?userid=$2  
  112.     RewriteRule ^(.*)/showforum-([0-9]+)\.html$  $1/showforum.aspx?forumid=$2  
  113.     RewriteRule ^(.*)/showtopic-([0-9]+)\.html$  $1/showtopic.aspx?topicid=$2  
  114.     RewriteRule ^(.*)/showforum-([0-9]+)-([0-9]+)\.html$  $1/showforum.aspx?forumid=$2&page=$3  
  115.     RewriteRule ^(.*)/showtopic-([0-9]+)-([0-9]+)\.html$  $1/showtopic.aspx?topicid=$2&page=$3  
  116.     RewriteRule ^(.*)/archiver/showforum-([0-9]+)\.html$  $1/archiver/showforum.aspx?forumid=$2  
  117.     RewriteRule ^(.*)/archiver/showtopic-([0-9]+)\.html$  $1/archiver/showtopic.aspx?topicid=$2  
  118.     RewriteRule ^(.*)/archiver/showtopic-([0-9]+)-([0-9]+)\.html$  $1/archiver/showtopic.aspx?topicid=$2&page=$3  
  119.     RewriteRule ^(.*)/archiver/showforum-([0-9]+)-([0-9]+)\.html$  $1/archiver/showforum.aspx?forumid=$2&page=$3  
  120.     RewriteRule ^(.*)/tools/rss-([0-9]+)\.html$  $1/tools/rss.aspx?forumid=$2  
  121.     RewriteRule ^(.*)/tools/spacerss-([0-9]+)\.html$  $1/tools/rss.aspx?uid=$2&type=space   
  122.     RewriteRule ^(.*)/tools/photorss-([0-9]+)\.html$  $1/tools/rss.aspx?uid=$2&type=photo   
  123.     RewriteRule ^(.*)/space\/((\w|\s)+)((\/?))?$  $1/space/index.aspx?user=$2  
  124.     RewriteRule ^(.*)/space\/((\w|\s|-)+)((\/?))?\?((.*)+)$  $1/space/index.aspx?user=$2&$6  
  125.   
  126.     RewriteRule ^(.*)/showdebate-([0-9]+)\.html$  $1/showdebate.aspx?topicid=$2  
  127.     RewriteRule ^(.*)/showbonus-([0-9]+)\.html$  $1/showbonus.aspx?topicid=$2  
  128.   
  129.     RewriteRule ^(.*)/postgoods-(\d+)*.html$  $1/postgoods.aspx?categoryid=$2  
  130.     RewriteRule ^(.*)/showgoodslist-(\d+)(-(\d+))?.html$  $1/showgoodslist.aspx?categoryid=$2&page=$4  
  131.     RewriteRule ^(.*)/showgoods-(\d+)*.html$  $1/showgoods.aspx?goodsid=$2  
  132.   
  133. #End dznt URL Rewrite settings   
  134.   
  135. #Start dvphp URL Rewrite settings   
  136.   
  137.     RewriteRule ^(.*?\/)(?:forum)-([-0-9]+)\/?$ $1index.php?__is_iis_rewrite=1&__rewrite_arg=$2  
  138.     RewriteRule ^(.*?\/)(?:board)-([-0-9]+)\/?$ $1dispbbs.php?__is_iis_rewrite=1&__rewrite_arg=$2  
  139.     RewriteRule ^(.*?\/)([_a-zA-Z]+)-([-0-9]+)\/?$ $1$2.php?__is_iis_rewrite=1&__rewrite_arg=$3  
  140.     RewriteRule ^(.*?(?:index|dv_forum|dispbbs))-([-0-9]+)\.html$ $1.php?__is_iis_rewrite=1&__rewrite_arg=$2  
  141. #End dvphp URL Rewrite settings   
  142.   
  143. #uchome   
  144. RewriteRule ^(.*)/(space|network)-(.+)\.html$ $1/$2\.php\?rewrite=$3 [L]   
  145. RewriteRule ^(.*)/(space|network)\.html$ $1/$2\.php [L]   
  146. RewriteRule ^(.*)/([0-9]+)$ $1/space\.php\?uid=$2 [L]   
  147. RewriteRule ^(.*)/archiver/((fid|tid)-[0-9]+\.html)\?*(.*)$ $1/archiver/index\.php\?$2&$4  
  148. #end uchome   
  149.   
  150. #dzx2.0  apache和iis通用(apache需去除[NU]参数)   
  151. RewriteEngine On   
  152. RewriteCond %{QUERY_STRING} ^(.*)$   
  153. RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2&%1  
  154. RewriteCond %{QUERY_STRING} ^(.*)$   
  155. RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3&%1  
  156. RewriteCond %{QUERY_STRING} ^(.*)$   
  157. RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1  
  158. RewriteCond %{QUERY_STRING} ^(.*)$   
  159. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1  
  160. RewriteCond %{QUERY_STRING} ^(.*)$   
  161. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3&%1  
  162. RewriteCond %{QUERY_STRING} ^(.*)$   
  163. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3&%1 [NU]   
  164. RewriteCond %{QUERY_STRING} ^(.*)$   
  165. RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&%1  
  166. RewriteCond %{QUERY_STRING} ^(.*)$   
  167. RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3&%1  
  168.   
  169. #dzx2.5 apache和iis通用(apache需去除[NU]参数)   
  170. RewriteEngine On   
  171. RewriteBase /   
  172. RewriteCond %{QUERY_STRING} ^(.*)$   
  173. RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1  
  174. RewriteCond %{QUERY_STRING} ^(.*)$   
  175. RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1  
  176. RewriteCond %{QUERY_STRING} ^(.*)$   
  177. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1  
  178. RewriteCond %{QUERY_STRING} ^(.*)$   
  179. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1  
  180. RewriteCond %{QUERY_STRING} ^(.*)$   
  181. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1  
  182. RewriteCond %{QUERY_STRING} ^(.*)$   
  183. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1 [NU]   
  184. RewriteCond %{QUERY_STRING} ^(.*)$   
  185. RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1  
  186. RewriteCond %{QUERY_STRING} ^(.*)$   
  187. RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1  
  188. RewriteCond %{QUERY_STRING} ^(.*)$   
  189. RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1  
  190.   
  191.     
  192.   
  193. #dzx3.0 apache和iis通用(apache需去除[NU]参数)   
  194. RewriteEngine On   
  195. RewriteBase /   
  196. RewriteCond %{QUERY_STRING} ^(.*)$   
  197. RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1  
  198. RewriteCond %{QUERY_STRING} ^(.*)$   
  199. RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1  
  200. RewriteCond %{QUERY_STRING} ^(.*)$   
  201. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1  
  202. RewriteCond %{QUERY_STRING} ^(.*)$   
  203. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1  
  204. RewriteCond %{QUERY_STRING} ^(.*)$   
  205. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1  
  206. RewriteCond %{QUERY_STRING} ^(.*)$   
  207. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1 [NU]   
  208. RewriteCond %{QUERY_STRING} ^(.*)$   
  209. RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1  
  210. RewriteCond %{QUERY_STRING} ^(.*)$   
  211. RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1  
  212. RewriteCond %{QUERY_STRING} ^(.*)$   
  213. RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1  
  214.   

网站解析上线之后一般会有带www的和不带www的两个,通常未做任何处理搜索引擎会索引两个域名,而网站的权重也会随着域名的分散而分散。解决此问题的办法通常是通过301重定向来实现的。我这里主要说一下windows主机,用IIS架设的服务器通过Rewrite组件来实现的办法,当然一般Apach主机是通过修改.htaccess文件来到到目的的,其他还可以通过域名解析或者有服务器操作权限直接在系统管理员配置区完成301重定向。

对于windows主机,若服务器支持Rewrite重写可以在网站根目录外一般叫做other的文件夹,在下面找httpd.conf文件,用记事本打开该文件,并在下面写入如下代码(请将域名换成自己的域名)

  1. RewriteCond %{HTTP:Host} ^guangboju.net$   
  2. RewriteRule (.*) http://www.guangboju.net$1 [NC,R=301]  

这条规则的意思是,如果访问是guangboju.net,就跳转为www.guangboju.net。
如果一个站点上绑定了很多域名,全部都要跳转到一个,则第一行就要修改为

  1. RewriteCond %{HTTP:Host}  !^www.waiting8.com  

意思是如果不是www.waiting8.com就跳转到www.guangboju.net。
如果绑定了多个,如
①waiting8.com
②www.waiting8.com
③guangboju.net
④www.guangboju.net
仅仅不带www的跳转到对应www的,则添加两组规则即可:

  1. RewriteCond %{HTTP:Host} ^guangboju.net$   
  2. RewriteRule (.*) http://www.guangboju.net$1 [NC,R=301]   
  3. RewriteCond %{HTTP:Host} ^waiting8.com$   
  4. RewriteRule (.*) http://www.waiting8.com$1 [NC,R=301]  

很多做站的朋友都会遇到这样的情况,在整理网站数据表的时候突然发现清空了某个数据表的全部数据后重新发布新内容,内容Id并不是从0直接开始的,而是接着以前的数据的Id自增,对于有ID控的朋友自然心里不爽。

最近我在测试网站的时候也遇到了这种情况,下面提出解决方案。

打开Mysql数据库,运行sql语句

truncate table 你的表名;

运行之后不但将该表的数据全部删除,而且重新定位自增的字段为1。

老师用ecshop做了一个电子商务网站,在网上找了一个侧栏悬浮的在线客服插件,其实也算不上插件吧,几个文件在首页引用了一下就可以了。样式还可以,但是昨天上网随便看看,发现自用的谷歌浏览器点击在线客服后有点问题。鼠标移动到联系客服的地方页面会弹出来,但是准备点上面的QQ去联系的时候又自动缩回去了,经测试IE和火狐下面正常。

关于ecshop的客服插件稍后会在本文下部提供下载连接,另外给出原帖连接http://bbs.ecshop.com/thread-92214-1-1.html

此问题主要是javescript代码与浏览器不兼容导致的,作者只处理了IE与Firefox的兼容问题,这个在第十四还是十几页的回贴中也给出了明确回答。

针对此问题的解决办法如下:

找到ServiceQQ.js文件,用编辑器打开(不要直接双击)
查找以下代码

  1. if (browser.indexOf(“Firefox”)>0){ //如果是Firefox  

更改为

  1. if (browser.indexOf(“Firefox”)>0||browser.indexOf(“Chrome”)>0||browser.indexOf(“Safari”)>0){ //如果是Firefox或Chrome或Safari  

然后查找以下代码

  1. if (browser.indexOf(“MSIE”)>0){ //如果是IE  

更改为

  1. if (browser.indexOf(“MSIE”)>0|| browser.indexOf(“Presto”)>=0){ //如果是IE或Opera  

替换相应代码之后保存即可。

此解决方法来源于http://bbs.ecshop.com/thread-179740-1-1.html

亲测可行,演示地址http://www.hotost.com