iis6 httpd.ini
[ISAPI_Rewrite]<br />3600 = 1 hour<br /><br />CacheClockRate 3600<br />RepeatLimit 32<br />RewriteRule /$ /? [L]<br />RewriteRule ^/topic/(.*) /\?\/topic/$1 [L]<br />RewriteRule ^/users/(.*) /\?\/users/$1 [L]<br />RewriteRule ^/favorite/(.*) /\?\/favorite/$1 [L]<br />RewriteRule ^/explore/(.*) /\?\/explore/$1 [L]<br />RewriteRule ^/notifications/(.*) /\?\/notifications/$1 [L]<br />RewriteRule ^/inbox/(.*) /\?\/inbox/$1 [L]<br />RewriteRule ^/people/(.*) /\?\/people/$1 [L]<br />RewriteRule ^/setting/(.*) /\?\/setting/$1 [L]<br />RewriteRule ^/logout/(.*) /\?\/logout/$1 [L]<br />RewriteRule ^/publish/(.*) /\?\/publish/$1 [L]<br />RewriteRule ^/feature/(.*) /\?\/feature/$1 [L]<br />RewriteRule ^/home/(.*) /\?\/home/$1 [L]<br />RewriteRule ^/account/(.*) /\?\/account/$1 [L]<br />RewriteRule ^/login/(.*) /\?\/login/$1 [L]<br />RewriteRule ^/reader/(.*) /\?\/reader/$1 [L]<br />RewriteRule ^/search/(.*) /\?\/search/$1 [L]<br />RewriteRule ^/crond/(.*) /\?\/crond/$1 [L]<br />RewriteRule ^/invitation/(.*) /\?\/invitation/$1 [L]<br />RewriteRule ^/admin/(.*) /\?\/admin/$1 [L]<br />RewriteRule ^/m/(.*) /\?\/m/$1 [L]<br />RewriteRule ^/question/(.*) /\?\/question/$1 [L]<br />RewriteRule ^/category/(.*) /\?\/home/explore/category/$1 [L] <br />RewriteRule ^/feed/(.*) /\?\/feed/$1 [L]<br />RewriteRule ^/article/(.*) /\?\/article/$1 [L]<br /><br />iis7 web.config
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="wecenter" stopProcessing="true"> <match url="^(.*)$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php" appendQueryString="true" /> </rule> </rules> </rewrite> </system.webServer> </configuration><br /><br /><br />nginx:在对应的nignx.conf文件里面添加<br />location / {<br />if (!-e $request_filename)<br />{<br />rewrite (.*) /index.php;<br />}<br />}<br /><br />Apache:在对应的httpd.conf或者.htaccess里面添加<br /><IfModule mod_rewrite.c><br />RewriteEngine on<br />RewriteCond %{REQUEST_FILENAME} !-d<br />RewriteCond %{REQUEST_FILENAME} !-f<br />RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]<br /></IfModule>