泳裤王子不在
This is tclh123's second blog which is host by the lovely GAE. BTW, fuck the GFW.
rss
email
twitter
facebook
  • Home
  • <li class="page_item"><a href="/About" target="">About</a></li>

wordpress multisite using subdomain/ iis + url rewrite module 2.0 / web.config

0 Comments
Posted on 十月 26 2012
<p>上次配好wp多人博客后,使用时发现点击固定链接后会报404,想必是当时url rewrite没做好。</p> <p>这次去看,发现当时是根据wp的提示用了.htaccess文件来做url重写的,果断二了,哥用的是iis饿。。</p> <p>(因为学院官网是asp.net的,然后我要做subdomain又不能带端口,所以就没法用apache了。。。</p> <p>上网查了下iis下替代.htaccess的貌似是httpd.ini,然后又各种查搞不出来啊 - -。</p> <p>然后搜到<a href="http://www.helicontech.com/forum/18684-WordPress_Multisite_Permalinks_IIS6.html">这个</a>,开始有点无力了.....</p> <p>然后换了个思路...发现可以用web.config这样...<a href="http://lauragentry.com/blog/2010/07/30/how-to-create-a-wordpress-3-0-multisite-network-on-a-windows-server-using-sub-directories/">这里</a>..(有点不一样,他用的是subdirectory</p> <p>然后发现了貌似很吊的<a href="http://www.iis.net/downloads/microsoft/url-rewrite">iis url rewrite 2.0</a>...</p> <p>然后对比着wp给的.htaccess重写规则改写成web.config了...</p> <p><!--more--></p> <p>1、.htaccess</p> <p>&nbsp;</p> <pre class="brush: bash;fontsize: 100; first-line: 1; ">RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule . index.php [L]</pre> <p>2、web.config</p> <p>&nbsp;</p> <pre class="brush: xml;fontsize: 100; first-line: 1; ">&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;configuration&gt; &lt;system.webServer&gt; &lt;rewrite&gt; &lt;rules&gt; &lt;rule name="WordPress Rule 1" stopProcessing="true"&gt; &lt;match url="^index\.php<!--more--><span id="_mce_tmp">XX</span>quot; ignoreCase="false" /&gt; &lt;action type="None" /&gt; &lt;/rule&gt; &lt;rule name="WordPress Rule 2" stopProcessing="true"&gt; &lt;match url="^files/(.+)" ignoreCase="false" /&gt; &lt;action type="Rewrite" url="wp-includes/ms-files.php?file={R:1}" appendQueryString="false" /&gt; &lt;/rule&gt; &lt;rule name="WordPress Rule 4" stopProcessing="true"&gt; &lt;match url="^" ignoreCase="false" /&gt; &lt;conditions logicalGrouping="MatchAny"&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" /&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" /&gt; &lt;/conditions&gt; &lt;action type="None" /&gt; &lt;/rule&gt; &lt;rule name="WordPress Rule 7" stopProcessing="true"&gt; &lt;match url="." ignoreCase="false" /&gt; &lt;action type="Rewrite" url="index.php" /&gt; &lt;/rule&gt; &lt;/rules&gt; &lt;/rewrite&gt; &lt;/system.webServer&gt; &lt;/configuration&gt;</pre> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>最后,运行正常~OK~</p> <p><a href="http://tclh123.blog.sssta.co/">http://tclh123.blog.sssta.co/</a></p> <p>&nbsp;</p> --End--

Tags:  
Categories:

Leave a Reply

+=



About Me

    Harry Lee
    Student in Software Engineering
    [email protected], Zhejiang
    [email protected]Xidian University
    more...

Feeds

  • Entries (RSS)
  • Comments (RSS)
  • 订阅到 Google Reader
  • 订阅到 抓虾
  • 订阅到 鲜果
  • 订阅到 QQ

Popular Posts

  • Macbook pro 装 Ubuntu12.4 的BCM4331无线网卡驱动(9479)
  • rvm使用淘宝ruby镜像(6944)
  • [转载] Wordpress Rewrite / Permalink内部过程分析(6664)
  • XQuartz-2.7.3.dmg下载地址,x11 for mac...(6598)
  • wordpress multisite using subdomain/ iis + url rewrite module 2.0 / web.config(6513)
  • google app engine sdk directory on macos/osx(6291)
  • sublime text 2 for osx,build system,open terminal window(6076)
  • sublime text 2 for osx / python build system(5890)

Recent Posts

  • Use Octpress
  • rvm使用淘宝ruby镜像
  • [笔记整理]Regular Expression / 正则表达式
  • sublime text 2 for osx / python build system
  • wordpress multisite using subdomain/ iis + url rewrite module 2.0 / web.config
  • google app engine sdk directory on macos/osx
  • Macbook pro 装 Ubuntu12.4 的BCM4331无线网卡驱动
  • XQuartz-2.7.3.dmg下载地址,x11 for mac...

Recent Comments

Categories

Archives

Blog roll


  • Home
  • <li class="page_item"><a href="/About" target="">About</a></li>
  • Login
Powered by Google App Engine  |   Designed by WebTreats  |   由 xuming 提供 Micolog程序