28 1 月 2013

域名解析 相关知识

我写文的频率太少了。主要是太懒。但是这么长的寒假,还是要有些耐性写写东西的。

开头的定义:

域名解析是把域名指向网站空间IP,让人们通过注册的域名可以方便地访问到网站一种服务。域名解析也叫域名指向、服务器设置、域名配置以及反向IP登记等等。说得简单点就是将好记的域名解析成IP,服务由DNS服务器完成,是把域名解析到一个IP地址,然后在此IP地址的主机上将一个子目录与域名绑定。

下面上具体的作法。我现在有的域名注册商有许多。

我就用tk域名的来做解释

网址http://my.dot.tk 这是一个免费域名提供商 当然它是有限制的。最高注册12个月,每月要有一定的访问量。

首先进入账户首页。

 

点击放大

再点击domain panel

下面的列表显示已注册域名

点击放大

 

我用movitip这个域名解释(因为好像并没有用过)

 

点击放大

点击modify进行配置

 

出现下面的界面

点击放大

1.NS记录

我用的是它的NS记录功能。(新手不建议)

NS(Name Server)记录是域名服务器记录,用来指定该域名由哪个DNS服务器来进行解析。您注册域名时,总有默认的DNS服务器,每个注册的域名都是由一个DNS域名服务器来进行解析的,DNS服务器NS记录地址一般以以下的形式出现:
ns1.domain. com
ns2.domain. com等
般提供域名服务的公司不建议您换NS,除非你比较懂DNS,或者有一个DNS提供商给你提供DNS服务。如果您换了自己的域名的DNS服务器的话就需要到您DNS服务商的控制面板去解析自己的域名。
用了这个功能,那就用转到的那个服务器区配置。直接可以参照下面的配置。
2.网址转发功能(比较低级的功能,菜鸟用的一般)

点击放大

这个不要多解释鸟。就是实现打开这个网址,直接进入你配置的网址里了。
3.A记录
点击放大
A (Address) 记录是用来指定主机名(或域名)对应的IP地址记录。用户可以将该域名下的网站服务器指向到自己的web server上。同时也可以设置域名的子域名。
通俗来说A记录就是服务器的IP,域名绑定A记录就是告诉DNS,当你输入域名的时候给你引导向设置在DNS的A记录所对应的服务器。
A记录是用来和主机空间绑定的。大家都知道,域名绑定是两方面的事情,一个是域名这里的设置,要用各种方式的记录转向主机ip地址。另一个是主机空间那里要接受这个地址(当然以后会写一下怎么强制绑定)。
后者的主机空间有ip地址提供的,当然正常情况下,你先去主机那里绑域名,它会提示你解析到哪个地址。
所以,总结下,A记录这里填主机的ip地址。如:

点击放大

 

tk域名比较奇葩,他还有host name要写,一般直接写域名地址好了,其他域名没有这一项。
4.CNAME记录

别名记录(CNAME)
也被称为规范名字。这种记录允许您将多个名字映射到同一台计算机。 通常用于同时提供WWW和MAIL服务的计算机。例如,有一台计算机名为“host”(A记录)。 它同时提供WWW和MAIL服务,为了便于用户访问服务。可以为该计算机设置两个别名(CNAME):WWW和MAIL。 这两个别名的全称就是www开头的域名和以mail开头的域名。实际上他们都指向“host”。 同样的方法可以用于当您拥有多个域名需要指向同一服务器IP,此时您就可以将一个域名做A记录指向服务器IP然后将其他的域名做别名到之前做A记录的域名上,那么当您的服务器IP地址变更时您就可以不必麻烦的一个一个域名更改指向了 只需要更改做A记录的那个域名其他做别名的那些域名的指向也将自动更改到新的IP地址上了。
上面是你度娘给的。
我的解释是。它是一种指向主机空间提供的域名的一种解析方式。效果最终还是和A记录一样的。因为指向的cname记录的那个域名,其实它是有地址的。

点击放大

有些空间服务商的主机ip是经常变动的,所以做别名解析的好处就显而易见了,避免了用户名频繁换域名的A记录。主机提供的域名的记录他们自己换一下,就行了。
提供这种的解析的空间最常见的有谷歌,百度等大公司,而且多是云主机。
5.MX记录

是邮件交换记录,它指向一个邮件服务器,用于电子邮件系统发邮件时根据 收信人的地址后缀来定位邮件服务器。例如,当Internet上的某用户要发一封信给 user@mydomain.com 时,该用户的邮件系统通过DNS查找mydomain.com这个域名的MX记录,如果MX记录存在, 用户计算机就将邮件发送到MX记录所指定的邮件服务器上。
MX记录也叫做邮件路由记录,用户可以将该域名下的邮件服务器指向到自己的mail server上,然后即可自行操控所有的邮箱设置
一般用不到这个功能滴。因为大家多用那些专业邮箱,gmail,hotmail,qq,163等等。
再者,大多数空间服务商不提供邮件服务器功能。
这个和A记录相似,我的blogfeng@blogfeng.com这个邮箱就是用的mx记录做的,推荐使用的谷歌app 和腾讯企业邮箱。我用的前者。
操作的时候直接在邮件服务器上绑域名,然后它会提供ip地址,直接写邮件服务器ip地址即可。

点击放大

做好后。邮件服务器那里可以设置用户名 yourname@yourdomain这种形式。其实蛮好用的,说实话。
登陆地址是mail.yourdomain的形式。
25 1 月 2013

分享 破除wordpress每次都要输入ftp账号信息

有些开启有安全模式的主机空间,需要破除每次都要输入ftp的麻烦。最好的当然是在后台关掉安全模式。
blogfeng推荐的方式是在wp-config文件中写入ftp信息。


define('DB_COLLATE', '');
define('FTP_USER','####');// FTP 或SSH用户名
define('FTP_PASS', '###'); // FTP用户密码
define('FTP_HOST', 'ftp://###'); //主机名:你的SSH/FTP服务器端

18 1 月 2013

url重写规则

IIS6

<RewriterConfig>
   <Rules>
       
      无参数一级页面
     <RewriterRule>
       <LookFor>~/([\0-9a-zA-Z]+)-([\d]+)/([\w-]+)\.html</LookFor>
       <SendTo><![CDATA[~/$1.aspx?classid=$2&ke=$3]]></SendTo>
     </RewriterRule>
     <RewriterRule>
       <LookFor>~/([0-9a-zA-Z]+)\.html</LookFor>
       <SendTo><![CDATA[~/$1.aspx]]></SendTo>
     </RewriterRule>     
     <RewriterRule>
       <LookFor>~/about-(\d{1,6})\.html</LookFor>
       <SendTo>~/about.aspx?id=$1</SendTo>
     </RewriterRule>
     <RewriterRule>
       <LookFor>~/about8.html</LookFor>
       <SendTo>~/about8.aspx</SendTo>
     </RewriterRule>
     <RewriterRule>
       <LookFor>~/newsbig-(\d{1,6})\.html</LookFor>
       <SendTo>~/newsbig.aspx?id=$1</SendTo>
     </RewriterRule>
     <RewriterRule>
       <LookFor>~/news-(.*)\.html</LookFor>
       <SendTo>~/news.aspx?ke=$1</SendTo>
     </RewriterRule>
     <RewriterRule>
       <LookFor>~/pro-(.*)\.html</LookFor>
       <SendTo>
         <![CDATA[~/pro.aspx?classid=$1]]>
     </SendTo>
     </RewriterRule>
     <RewriterRule>
       <LookFor>~/pro2-(.*)\.html</LookFor>
       <SendTo>~/pro2.aspx?ke=$1</SendTo>
     </RewriterRule>
     <RewriterRule>
       <LookFor>~/prob-(.*)-(.*)\.html</LookFor>
       <SendTo>
         <![CDATA[~/prob.aspx?id=$1&name=$2]]>
     </SendTo>
     </RewriterRule>
     <RewriterRule>
       <LookFor>~/probig-(\d{1,6})-(.*)\.html</LookFor>
       <SendTo>~/probig.aspx?id=$1</SendTo>
       <SendTo> <![CDATA[~/probig.aspx?id=$1&columnid=$2]]></SendTo>
     </RewriterRule>
     <RewriterRule>
       <LookFor>~/viewnews-(\d{1,6})\.html</LookFor>
       <SendTo>~/viewnews.aspx?id=$1</SendTo>
     </RewriterRule>
     <RewriterRule>
       <LookFor>~/products-(\d{1,6})\.html</LookFor>
       <SendTo>~/products.aspx?pid=$1</SendTo>
     </RewriterRule>
     <RewriterRule>
       <LookFor>~/products-(\d{1,6})\.html</LookFor>
       <SendTo>~/products.aspx?page=$1</SendTo>
     </RewriterRule>
     <RewriterRule>
       <LookFor>~/products-(\d{1,6})-(\d{1,6})\.html</LookFor>
       <SendTo><![CDATA[~/products.aspx?pid=$1&page=$2]]></SendTo>
     </RewriterRule>
     <RewriterRule>
       <LookFor>~/job-(\d{1,6})\.html</LookFor>
       <SendTo>~/job.aspx?page=$1</SendTo>
     </RewriterRule>

    
     <RewriterRule>
       <LookFor>~/yingping-(\d{1,6})\.html</LookFor>
       <SendTo>~/yingping.aspx?jid=$1</SendTo>
     </RewriterRule>

     <RewriterRule>
       <LookFor>~/viewproduct-(\d{1,6})-([\w-]+)\.html</LookFor>
       <SendTo>~/viewproduct.aspx?id=$1</SendTo>
     </RewriterRule>

      英文版
     <RewriterRule>
       <LookFor>~/en/([0-9a-zA-Z]+)\.html</LookFor>
       <SendTo><![CDATA[~/en/$1.aspx]]></SendTo>
     </RewriterRule>

     <RewriterRule>
       <LookFor>~/en/news-(\d{1,6})\.html</LookFor>
       <SendTo>~/en/news.aspx?page=$1</SendTo>
     </RewriterRule>

     <RewriterRule>
       <LookFor>~/en/viewnews-(\d{1,6})\.html</LookFor>
       <SendTo>~/en/viewnews.aspx?id=$1</SendTo>
     </RewriterRule>

     <RewriterRule>
       <LookFor>~/en/products-(\d{1,6})\.html</LookFor>
       <SendTo>~/en/products.aspx?pid=$1</SendTo>
     </RewriterRule>

     <RewriterRule>
       <LookFor>~/en/products-(\d{1,6})\.html</LookFor>
       <SendTo>~/en/products.aspx?page=$1</SendTo>
     </RewriterRule>

     <RewriterRule>
       <LookFor>~/en/products-(\d{1,6})-(\d{1,6})\.html</LookFor>
       <SendTo><![CDATA[~/en/products.aspx?pid=$1&page=$2]]></SendTo>
     </RewriterRule>

     <RewriterRule>
       <LookFor>~/en/job-(\d{1,6})\.html</LookFor>
       <SendTo>~/en/job.aspx?page=$1</SendTo>
     </RewriterRule>

     <RewriterRule>
       <LookFor>~/en/yingping-(\d{1,6})\.html</LookFor>
       <SendTo>~/en/yingping.aspx?jid=$1</SendTo>
     </RewriterRule>

     <RewriterRule>
       <LookFor>~/en/viewproduct-(\d{1,6})\.html</LookFor>
       <SendTo>~/en/viewproduct.aspx?id=$1</SendTo>
     </RewriterRule>

   </Rules>
 </RewriterConfig>
IIS7 (注意顺序)

<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
   <system.webServer>
       <rewrite>
           <rules>
               <clear />
               <rule name=”LowerCaseRule1″ stopProcessing=”true”>
                   <match url=”[A-Z]” ignoreCase=”false” />
                   <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
                   <action type=”Redirect” url=”{ToLower:{URL}}” />
               </rule>
               <rule name=”asp” enabled=”false” patternSyntax=”ECMAScript” stopProcessing=”true”>
                   <match url=”.*.(?:asp|aspx|php|jsp|cgi|ini|mdb|config|bak)” negate=”false” />
                   <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
                   <action type=”Rewrite” url=”/err.asp” />
               </rule>
               <rule name=”html3″ patternSyntax=”ECMAScript” stopProcessing=”true”>
                   <match url=”^([0-9,a-z,/]+)_([0-9,a-z]+)_([0-9]+)_([0-9]+)\.html$” />
                   <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
                   <action type=”Rewrite” url=”{R:1}.asp?game={R:2}&amp;typeid={R:3}&amp;id={R:4}” />
               </rule>
               <rule name=”html2″ patternSyntax=”ECMAScript” stopProcessing=”true”>
                   <match url=”^([0-9,a-z,/]+)_([0-9,a-z]+)_([0-9]+)\.html$” />
                   <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
                   <action type=”Rewrite” url=”{R:1}.asp?game={R:2}&amp;typeid={R:3}” />
               </rule>
               <rule name=”html1″ patternSyntax=”ECMAScript” stopProcessing=”true”>
                   <match url=”^([0-9,a-z,/]+)_([0-9,a-z]+)\.html$” negate=”false” />
                   <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
                   <action type=”Rewrite” url=”{R:1}.asp?game={R:2}” />
               </rule>
               <rule name=”html0″ patternSyntax=”ECMAScript” stopProcessing=”true”>
                   <match url=”^([0-9,a-z,/]+)\.html$” ignoreCase=”true” />
                   <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
                   <action type=”Rewrite” url=”{R:1}.asp” />
               </rule>
           </rules>
       </rewrite>
       <defaultDocument>
           <files>
               <add value=”index.asp” />
           </files>
       </defaultDocument>
       <httpErrors>
           <error statusCode=”500″ subStatusCode=”100″ path=”/500-100.asp” responseMode=”ExecuteURL” />
       </httpErrors>
   </system.webServer>
   <location path=”mh”>
   </location>
</configuration>
IIS7 重写IIS6的 (注意顺序)有的地方需调整

<rewrite>
     <rules>
       <clear />
   <rule name=”html1″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^([\0-9a-zA-Z]+)-([\d]+)/([\w-]+)\.htm” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”{R:1}.aspx?classid={R:2}&amp;ke={R:3}” />
   </rule>

   <rule name=”html3″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^about-(\d{1,6})\.html$” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”about.aspx?id={R:1}” />
   </rule>
  <!– <rule name=”html4″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”about.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”about.aspx” />
   </rule>–>
   <rule name=”html5″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^newsbig-(\d{1,6})\.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”newsbig.aspx?id={R:1}” />
   </rule>
   <rule name=”html6″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^news-(.*)\.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”news.aspx?classid={R:1}” />
   </rule>  

   <rule name=”html7″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^pro-(.*)\.html$” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”pro.aspx?classid={R:1}” />
   </rule>
   <rule name=”html8″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^pro2-(.*)\.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”pro2.aspx?ke={R:1}” />
   </rule>
   <rule name=”html9″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^prob-(.*)-(.*)\.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”prob.aspx?id={R:1}&amp;name={R:2}” />
   </rule>
   <rule name=”html10″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^probig-(\d{1,6})-(.*)\.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”probig.aspx?id={R:1}&amp;columnid={R:2}” />
   </rule>
   <rule name=”html11″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^viewnews-(\d{1,6})\.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”viewnews.aspx?id={R:1}” />
   </rule>
   <rule name=”html12″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^products-(\d{1,6})\.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”products.aspx?pid={R:1}” />
   </rule>
   <rule name=”html13″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^products-(\d{1,6})\.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”products.aspx?page={R:1}” />
   </rule>
   <rule name=”html14″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^products-(\d{1,6})-(\d{1,6})\.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”pproducts.aspx?pid={R:1}&amp;page={R:2}” />
   </rule>
   <rule name=”html15″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^job-(\d{1,6})\.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”job.aspx?page={R:1}” />
   </rule>
   <rule name=”html16″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^yingping-(\d{1,6})\.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”yingping.aspx?jid={R:1}” />
   </rule>
   <rule name=”html17″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^viewproduct-(\d{1,6})-([\w-]+)\.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”viewproduct.aspx?id={R:1}” />
   </rule>
<!–<rule name=”html18″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”about\.html” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”about.aspx” />
   </rule>–>
<rule name=”html19″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^probig-(\d{1,6})\.html$” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”probig.aspx?id={R:1}” />
   </rule>
 <rule name=”html20″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^pro.html?classid=(.*)$” ignoreCase=”true” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”pro.aspx?classid={R:1}” />
   </rule>
  
  <rule name=”html22″ patternSyntax=”ECMAScript” stopProcessing=”true”>
     <match url=”^([0-9a-zA-Z]+)\.html” negate=”false” />
     <conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
     <action type=”Rewrite” url=”{R:1}.aspx” />
   </rule>
     </rules>
   </rewrite>

 

来自:http://blog.sina.com.cn/s/blog_79a08b290100x6a1.html

11 1 月 2013

Robots的使用&搜索引擎是如何工作的

1.Robots.txt是一个文本文件,关键是这个文件所在的位置:在网站的根目录下。

2.

遵循语法的Robots.txt才可能被机器人识别,至于语法,介绍起来很繁琐,现简单举例如下:

1)禁止所有搜索引擎访问网站的任何部分(也就是网站彻底的拒绝所有搜索引擎收录)

User-agent: *

Disallow: /

2)允许所有的robot访问(也就是网站允许所有搜索引擎收录)

User-agent: *

Disallow:

3)禁止某个搜索引擎的访问(比如禁止百度收录,按如下的方式写)

User-agent: baiduspider

Disallow: /

4)允许某个搜索引擎的访问(比如允许百度收录,按如下的方式写)

User-agent: baiduspider

Disallow:

User-agent: *

Disallow: /

5)禁止搜索引擎访问某些目录

User-agent: *

Disallow: /cgi-bin/

Disallow: /tmp/

Disallow: /images/

 

 

所有语句都是单规则的,即每行仅声明一条规则

 

3.搜索引擎如何工作

按搜索方式可以分为 全文搜索 和 目录搜索 两种。

所谓全文搜索,是搜索引擎通过从网页自动提取信息来建立数据库的过程。至于提取的原理,就是SEO狂热者们所研究的算法,在他们的理想情况下,网页应该是针对搜索引擎设计的,具有最好的收录效果。当然,不是本文的话题。搜索引擎的自动信息搜集功能分两种。一种是定期搜索,即每隔一段时间(比如Google一般是28天),搜索引擎主动派出“蜘蛛”程序,对一定IP地址范围内的互联网站进行检索,一旦发现新的网站,它会自动提取网站的信息和网址加入自己的数据库。另一种是提交网站搜索,即网站拥有者主动向搜索引擎提交网址,它在一定时间内(2天到数月不等)定向向你的网站派出“蜘蛛”程序,扫描你的网站并将有关信 息存入数据库,以备用户查询。

与全文搜索引擎相比,目录索引有许多不同之处。目录索引完全是手工操作的。

首先,搜索引擎属于自动网站检索,而目录索引则完全依赖手工操作。用户提交网站后,目录编辑人员会亲自浏览你的网站,然后根据一套自定的评判标准甚至编辑人员的主观印象,决定是否接纳你的网站。

其次,搜索引擎收录网站时,只要网站本身没有违反有关的规则,一般都能登录成功。而目录索引对网站的要求则高得多,有时即使登录多次也不一定成功。尤其象Yahoo!这样的超级索引,登录更是困难。

最后,搜索引擎中各网站的有关信息都是从用户网页中自动提取的,所以用户的角度看,我们拥有更多的自主权;而目录索引则要求必须手工另外填写网站信息,而 且还有各种各样的限制。更有甚者,如果工作人员认为你提交网站的目录、网站信息不合适,他可以随时对其进行调整,当然事先是不会和你商量的。

目录索引,顾名思义就是将网站分门别类地存放在相应的目录中,因此用户在查询信息时,可选择关键词搜索,也可按分类目录逐层查找。如以关键词搜索,返回的结果跟搜索引擎一样,也是根据信息关联程度排列网站,只不过其中人为因素要多一些。

09 1 月 2013

怎样判断手机还是pc浏览器

php

代码

1.

<?php
$mobile_browser = 1;

if (strpos(strtolower($_SERVER[‘HTTP_USER_AGENT’]),’windows nt’)>0
|| strpos(strtolower($_SERVER[‘HTTP_USER_AGENT’]),’windows xp’)>0
|| strpos(strtolower($_SERVER[‘HTTP_USER_AGENT’]),’winnt’)>0
|| strpos(strtolower($_SERVER[‘HTTP_USER_AGENT’]),’windows 2000′)>0
|| strpos(strtolower($_SERVER[‘HTTP_USER_AGENT’]),’windows 98′)>0
) {
$mobile_browser=0;
}
if($mobile_browser>0) {
die(require_once( dirname(__FILE__) . ‘http://y.blogfeng.tk’)); // 跳转到手机版的主页
}else {
die(require_once( dirname(__FILE__) . ‘http://feng.cz.cc’)); // 跳转到电脑版的主页
}
?>

 

2.
<?php
function is_wap()
{
$ua=strtolower($_SERVER[‘HTTP_USER_AGENT’]);
$uachar = “/(untrusted|nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|wap|mobile)/i”;
if(($ua == ” || preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER[‘REQUEST_URI’]),’wap’))
{
return true;
}
else
{
return false;
}
}

if(is_wap())
{
header(‘Location: http://y.blogfeng.tk’);
exit;
}
else
{
header(‘Location: http://feng.cz.cc’);
exit;
}
?>

 

 

 

08 1 月 2013

ftp工具 & 分享 一个很好的在线ftp管理

在线ftp地址http://www.net2ftp.com/index.php

1.一般的ftp管理,学长以前告诉我的是直接用windows自带方式。当时真的是吃了他不少亏呢。小文件用这个倒是没问题,简单方便。但是大文件,加上空间不给力的话,那就是坑爹。blogfeng经常望着文件传输不时中断无语。

 

 

2.给力的经典ftp管理软件FlashFXP 支持断点续传,支持后台运行,支持完成指令后设置。超级无敌。

 

3.本文博客风要推荐的在线ftp管理。超级好用。网址在最顶端。

 

4.自己在空间搭建ftp管理,软件在这,直接上传即可。

05 1 月 2013

利用dropbox实现永久不失效的超级公共链接

dropbox注册地址,点击

 

dropbox是全世界专业做网盘图片存储的,而且特点就是链接永远不失效。国内的金山快盘无可比拟。

有什么用?

做空间,博客,论坛的图片,再也不需要上传了,只需一个链接。

附件提供别人下载页不需要迅雷等等,不需要续期担心链接过期。

等等。

但是由于天朝担心国内使用过多影响和谐,所以最近dropbox的美国东部的ip被和谐了,不能实现外链功能。!!注意只要不共享外链,做图床,但是可以自己上传和下载!

但是,规则就是用来破解的。

只需轻松一步,即可实现外链。

第一步,先正常生成link share,

然后点击download,

复制地址:一般是https://dl.dropbox.com/s/…….的形形式第二步关键:把上述地址https://dl.dropbox.com这一部分修改成http://d.blogfeng.tk即可

 

或者
http://dl.dropboxusercontent.com

修改后:

注意了!!!https!要改成http!!!不要忘记!前者加密协议传输!

03 1 月 2013

Problem about wordpress 博客首页不更新

今天进wordpress就发现一个问题,就是发了几篇日志,发现首页也没有变化,这才开始怀疑首页是否有过更新。

解决了问题:
可以自行控制是否缓存首页,打开cos-html-cache.php,修改下面这一行
  define('IS_INDEX',false);// false = do not create home page cache
按照以上提示,我的问题成功解决.首先进入我的博客后台,选择修改插件,找到cos-html-cache中的这一行,将原先的”true”修改”false“后,保存文件.然后用该插件更新一下博客缓存.更新完后,重新再禁用此插件,首页又能在发表新文章后自动更新了,此问题顺利解决.