Posts filed under '代码如诗'

利用.htaccess设置301转向

301转向的好处不言而喻,不仅规范了网址也可以增加跳转后域名的权重还能避免出现重复页面,同时也建立了域名的品牌效应,别人一看都跳到了另一个域名上肯定记住了这个域名。

RewriteEngine On
rewritecond %{http_host} ^openboy.net [nc]
rewriterule ^(.*)$ http://www.openboy.net/$1 [r=301,nc]
标签:, ,

Add comment 九月 18th, 2009

mediawiki的一些设置:LocalSettings.php

mediawiki的使用 的一些整理.也有人推荐dokuwiki些,设置简单,语法简洁.

mediawiki没有相应的控制面板,相关设置都是在根目录下修改LocalSettings.php这个文件.添加相关设置语句.

$wgGroupPermissions['*']['edit'] = false; //设置所有用户都不能编辑
$wgGroupPermissions['sysop']['edit'] = true; //设置管理员能编辑
$wgGroupPermissions['*']['createaccount'] = false; //禁止帐号注册
$wgLogo = 'http://*.jpg'; //首页logo图片修改
$wgAllowExternalImages = true;  //允许外链图片显示
$wgRawHtml = true;  //允许html代码调用
 
//时区设置
$wgLocaltimezone = "Asia/Shanghai";
putenv("TZ=$wgLocaltimezone");
$wgLocalTZoffset = date("Z") / 60;
标签:

Add comment 九月 17th, 2009

代码实现分享到delicious和twitter

最近twitter非常火,而delicious一直比较实用

简单用几行代码实现分享到这两个地方。

<span class="twitter">P.S. 如果你喜欢本文,把它分享到<a href="http://twitter.com/home?status=我正在看《<?php the_title(); ?>》这篇文章,还不错。文章链接:< ?php the_permalink() ?>" title="Click to send this page to Twitter!"> Twitter </a></span><span class="delicious">或者收藏到<a href="http://del.icio.us/post?url=<?php the_permalink() ?>"> Delicious </a>。</span>

css可以这么写

.twitter a {font-weight:700;color:#33ccff;background-color:#fff;}
.delicious a {font-weight:700;color:#3274D0;background-color:#fff;}
标签:, ,

Add comment 二月 20th, 2009



订阅YY’Notepad

YY’Notepad页面

热门关键字