EMER
  • blogger
  • Jone He
日历
标签
分类
存档
最新评论
Twitter
  • ただいま近くにおりません、ぴっという発信音の後にお名前、電話番号と用件をお話ください。
    2008-12-23 21:12
  • 资本是流动的,在流动过程中总会溅出那么一点,没有资本的人要做的就是能接住溅出的那部分!
    2008-12-09 14:08
  • 今天是值得记忆的日子——为了2009!
    2008-11-25 12:46
  • 星火 + 瘟疫 = SEO的最高境界!
    2008-11-16 08:49
  • 我很确信自己的脚下,却不知道往哪个方向迈,更不知道意义何在。
    2008-08-25 03:57
  • 最近在看的书《中国:奇迹的黄昏》
    2008-08-20 05:58
  • 快奥运了,有人很闲,有人很忙,我是后一种!
    2008-07-31 06:00
  • 有些事情,我还没有权利去做;有些快乐,我还没有权利去享受;而有些责任,我已经必须去承担。
    2008-07-07 09:04
  • 较早的»
最新日志
随机日志
音乐
链接
搜索
博客信息
  • 日志数量:22
  • 评论数量:7
  • 引用数量:0
  • 今日访问:58
  • 总访问量:30718
订阅Rss

2008-8-23 22:49 Saturday

Nginx :
Here's my configure in nginx.conf:

if (!-e $request_filename) {
        rewrite ^/latest-links/.htm[l]?$ /index.php?list=latest last;
                rewrite ^/top-hits/.htm[l]?$ /index.php?list=top last;
                rewrite ^/latest-articles/.htm[l]?$ /index.php?list=latestarticles last;
        rewrite ^/(.*)detail/link-(.*)\.htm[l]?$ /detail.php last;
        rewrite ^/(.*)articles/article-(.*)/.htm[l]?$ /article.php last;
        rewrite ^/(.*)authors/author-(.*)\.htm[l]?$ /author.php last;
        rewrite ^/(.*)page-[0-9]+\.html$  /index.php last;
        rewrite ^/(.+)\.html$ /page.php?name=$1 last;
        rewrite ^/(.*)$ /index.php last;
 }

Apache:
Here’s my modified .htaccess file:

#################################################
##           Apache Server Settings            ##
#################################################

# Prevent .htaccess and .htpasswd files from being viewed by web clients
<Files "^\.ht">
    Order allow,deny
    Deny from all
</Files>

# Protect files
<Files ~ "^(.*)\.(inc|inc\.php|tpl|sql)$">
  Order deny,allow
  Deny from all
</Files>

# Protect directories
<Files ~ "^(backup|files|images|include|lang|libs(/.+)?|temp(/.+)?|templates(/.+)?|javascripts(/.+)?)$">
  Order deny,allow
  Deny from all
</Files>

# Disable directory browsing
Options -Indexes

# Follow symbolic links in this directory
Options +FollowSymLinks

# Override PHP settings that cannot be changed at runtime
# (If your server supports PHP settings via htaccess you can comment following two lines off)
# php_value register_globals   0
# php_value session.auto_start 0

# Customized error messages
# ( If you are running in a subfolder please add it, example: "directory/index.php?httpstatus=404" )
ErrorDocument 404 index.php?httpstatus=404

# Set the default handler
DirectoryIndex index.php

# URL rewrite rules
<IfModule mod_rewrite.c>
   RewriteEngine On


   #Make sure RewriteBase points to the directory where you installed phpLD.
   #Example: "/phpld" if your installation is in a "phpld" subdirectory.

   #RewriteBase /

   ##Latest Links Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^latest-links\.htm[l]?$ index.php?list=latest [QSA,NC,L]

   ##Top Hits Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^top-hits\.htm[l]?$ index.php?list=top [QSA,NC,L]

   ##Latest Articles Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^latest-articles\.htm[l]?$ index.php?list=latestarticles [QSA,NC,L]

   ##Details Link Page Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule (.*)detail/link-(.*)\.htm[l]?$ detail.php [QSA,NC]

   ##Article Page Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule (.*)articles/article-(.*)\.htm[l]?$ article.php [QSA,NC]

   ##Author Page Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule (.*)authors/author-(.*)\.htm[l]?$ author.php [QSA,NC]

   ##Pagination Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule (.*)page-[0-9]+\.html$  index.php [QSA,NC,L]

##Pages redirect
   RewriteCond %{REQUEST_URI} !page-[0-9]+\.html?$
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^(.+)\.html$ page.php?name=$1 [NC,QSA,L]

   ##Category redirect
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

评论(0) 引用(0) 浏览(332)

2008-8-22 14:12 Friday

可以用下面一个来自google的函数,.

function _uFlash() {
 var f = "-", n = navigator;
 if (n.plugins && n.plugins.length) {
  for (var ii = 0; ii < n.plugins.length; ii++) {
   if (n.plugins[ii].name.indexOf('Shockwave Flash') != -1) {
    f = n.plugins[ii].description.split('Shockwave Flash ')[1];
    break;
   }
  }
 } else if (window.ActiveXObject) {
  for (var ii = 10; ii >= 2; ii--) {
   try {
    var fl = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + ii + "');");
    if (fl) {
     f = ii + '.0';
     break;
    }
   } catch (e) {
   }
  }
 }
 return f;
}
//alert(_uFlash());

标签: Flash JavaScript

评论(0) 引用(0) 浏览(368)