帮个忙~httpd.ini 转.htaccess,伪静态方法?

2014-03-25 23:19:09 +08:00
 webjin
[ISAPI_Rewrite]

# 3600 = 1 hour
CacheClockRate 3600

RepeatLimit 32

# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteRule ^(.*)/topic-(.+)\.html(\?(.*))*$ $1/portal\.php\?mod=topic&topic=$2&$4
RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/portal\.php\?mod=view&aid=$2&page=$3&$5
RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$5
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$6
RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=group&fid=$2&page=$3&$5
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html(\?(.*))*$ $1/home\.php\?mod=space&$2=$3&$5
RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/home\.php\?mod=space&uid=$2&do=blog&id=$3&$5
RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html(\?(.*))*$ $1/index\.php\?action=$2&value=$3&$5

RewriteRule ^(.*)/merchant\.html$ $1/plugin\.php\?id=merchant\:memcp&mobile=no
RewriteRule ^(.*)/merchant-([0-9]+)\.html$ $1/plugin\.php\?id=merchant\:memcp&mid\=$2&mobile=no
RewriteRule ^(.*)/mlist-([0-9]+)\.html$ $1/plugin\.php\?id=merchant\:memcp&catid=$2&mobile=no
RewriteRule ^(.*)/mlist-([0-9]+)-([0-9]+)\.html$ $1/plugin\.php\?id=merchant\:memcp&catid=$2&sort=$3&mobile=no
RewriteRule ^(.*)/merchant_([0-9]+)_([0-9]+)_([0-9]+)_([0-9])_([0-9])_([0-9])\.html$ $1/plugin\.php\?id=merchant\:memcp&catid=$2&sort=$3&reg=$4&r=$5&t=$6&s=$7&mobile=no


RewriteRule ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html(\?(.*))*$ $1/plugin\.php\?id=$2:$3&$5
3175 次点击
所在节点    PHP
1 条回复
Actrace
2014-03-26 17:02:53 +08:00
好蛋疼,我一般都用以下规则...
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/105891

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX