RewriteCond %{HTTP_HOST} ^(abc|www\.abc\.com).*$ [I]
RedirectRule ^/(.*)$ http://www.123.com/$1 [I,R=301]
iirf 通过301实现域名跳转
自己记录一下,几种放一起容易混,这样清晰一些.

,

==========================

RewriteRule ^/(?!index\.php|wp-|xmlrpc)(.*)$ /index.php/$1 [I,L]

#RewriteRule ^/(?!index.php)(?!wp)([^\.]*)$ /index.php/$1 [I]
#RewriteRule ^/category/diy /?cat=3
#RewriteRule ^/category/general /index.php?cat=1
#RewriteRule ^/category/house_reno /index.php?cat=4
#RewriteRule ^/category/pets /index.php?cat=138
#RewriteRule ^/category/photography /index.php?cat=5
#RewriteRule ^/page/([^/]+)$ /index.php?page_id=$1
#RewriteRule ^/tag/([^/]+)$ /index.php?tag=$1

==========================
IIRF的wordpress rewrite 规则
英文肯定没问题,没做测试,中文应该不是很好处理.

, ,

实现rewrite二级域名到文件夹,
Subdomain Rewrite IIRF作者写的
CondSubstringBackrefFlag %
RewriteCond %{HTTP_HOST} ^(?!www)([^.]+)\.tensay\.com
RewriteRule ^/(.*)$ /%1/$1 [L]

This says: for any HTTP_HOST that matches *.tensay.com but does not begin with www, fire the rewrite rule.
The rule says, for any URL at all – rewrite to a URL that contains the first segment of the HTTP_HOST

第一行 要添加一个 CondSubstringBackrefFlag %
iirf实现绑定二级域名到子目录

, ,

Isapi_rewrite和iirf都用这个规则就可以。

[ISAPI_Rewrite]

##### NOTE: Replace /shop/ with the relative web path of your catalog in the “Rewrite Base” line below:

Options +FollowSymLinks
Options FollowSymLinks
AllowOverride All
RewriteEngine On
RewriteBase /

# From Ultimate SEO URLs
RewriteRule ^(.*)-p-(.*).html /index.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-(.*).html /index.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+).html /index.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+).html /index.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+).html /index.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+).html /index.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]

# For Open Operations Info Manager
RewriteRule ^(.*)-i-([0-9]+).html /index.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L]

# For dreamscape’s News & Articles Manager
RewriteRule ^news/?$ index.php?main_page=news&%{QUERY_STRING} [L]
RewriteRule ^news/rss.xml /index.php?main_page=news_rss&%{QUERY_STRING} [L]
RewriteRule ^news/archive/? /index.php?main_page=news_archive&%{QUERY_STRING} [L]
RewriteRule ^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html /index.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING} [L]
RewriteRule ^news/archive/([0-9]{4})-([0-9]{2}).html /index.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+)-comments.html /index.php?main_page=news_comments&article_id=$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+).html /index.php?main_page=news_article&article_id=$2&%{QUERY_STRING} [L]

# All other pages
# Don’t rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html /index.php?main_page=$1&%{QUERY_STRING} [L]

, , , ,

Drupal  (all versions)

RewriteCond %{HTTP_HOST} ^(www\.yourdomainname\.com).*$ [I]
RedirectRule ^/(.*)$ http://yourdomainname.com/$1 [I,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(?!favicon.ico$)([^?]*)(?:\?(.*))?$ /index.php?q=$1&$2 [L]

WordPress (all versions)

RewriteCond %{HTTP_HOST} ^(yourdomainname\.com).*$ [I]
RedirectRule ^/(.*)$ http://www.yourdomainname.com/$1 [I,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*)$ /index.php/$1 [L]


IIS下rewrite存在的主要问题还是中文分类和tag的问题,不是很好解决,上面的规则在英文站点下没有任何问题。
, , , ,

IIS下 wordpress也可以有完美的rewrite
包含三种常用永久链接规则:

  • /post/%post_id%.html
  • /%year%/%monthnum%/%day%/%postname%/
  • /%year%/%monthnum%/%day%/%postname%.html
  • iis下 isapi_rewrite的规则

    Read the rest of this entry

    , , , ,

    RewriteCond %{HTTP_HOST} ^tensay\.com$ [I]
    RedirectRule ^/(.*)$ http://www.tensay.com/$1
    # 上面这两行是我的网站自己设置的 全站重定向不带www的自动转到带www的域名
    RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)\?*(.*)$ $1/archiver/index.php?$2&$4 [L]
    RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forumdisplay.php?fid=$2&page=$3&$4 [L]
    RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3&$4 [L]
    RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/space.php?$2=$3&$4 [L]
    RewriteRule ^(.*)/tag-(.+)\.html\?*(.*)$ $1/tag.php?name=$2&$3 [L]
    RewriteRule ^/(space|network)-(.+)\.html$ /$1.php?rewrite=$2 [L]
    RewriteRule ^/(space|network)\.html$ /$1.php [L]
    RewriteRule ^/([0-9]+)$ /space.php?uid=$1 [L]

    就是这样,搞了一晚上了,终于把iirf的规则弄的差不多了,以后边用边学。
    规则文件格式基本照搬ISAPI Rewrite,稍作修改
    RewriteRule [源URL正则条件] [目的URL]
    ISAPI Rewrite与IIRF的区别就在[目的URL],ISAPI Rewrite的要转义,而IIRF不用转义。
    如果网上有现成的ISAPI Rewrite的规则可以直接复制过来,将[目的URL]中的反斜杠(\)一个个删除就可以用在IIRF中用了。
    知道这个之后,你就可以随便在网上与人交流,按ISAPI Rewrite交流,最后把转义符(\)删掉就行了。

    , , ,

    用手工配置还是不行,plesk装完之后系统很多东西都不能自己设置了,IIRF的安装版,几个版本都有问题,
    今天终于成功安装上了,测试也成功,规则也简单。
    在官方论坛看了看,好像只有一个人是做开发的,这一个人更新也挺快的,有问题会很快解决的。
    支持开源的程序.
    用起来不错,支持站点自定义独立的iirf.ini
    以后慢慢方便了,规则不会因为几个网站不同而冲突了。
    以后有问题可以交流 QQ:87602040
    美国主机购买也可以交流 www.wangku.org  windows linux都有,asp .net php 也都有,rewrite的支持也比较完美了。
    最重要的是,现在免备案,没有任何担心了。

    ,

    做完3枚印章,然后做iirf的测试。
    确定iirf在plesk安装前可以在iis6上正常工作,
    然后iirf确定在plesk安装后如何工作。