htaccess伪静态规则转换Nginx
htaccess伪静态(是discuz伪静态来的):#将RewriteEngine模式打开RewriteEngineOn#修改以下语句中的RewriteBase后的地址为...
htaccess伪静态(是discuz伪静态来的):
# 将 RewriteEngine 模式打开
RewriteEngine On
# 修改以下语句中的RewriteBase 后的地址为你的论坛目录地址,如果程序放在根目录中,为 /,如果是相对论坛根目录是其他目录则写为 /{目录名},如:在bbs 目录下,则写为 /bbs
RewriteBase /
# Rewrite 系统规则请勿修改
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(\w+)/([0-9]+)$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^thread-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([a-z]+)-(.+)\.html$ $1.php?rewrite=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule forum-([0-9a-z_]+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
## 保留前面的部分可以不影响已经被搜索引擎收录的页面
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule /([0-9]+)(/([0-9]+))?(/)?$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$5&page=$3&%1 [L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([0-9a-z_]+)(/([0-9]+))?(/)?$ forum.php?mod=forumdisplay&fid=$1&page=$3&%1 [L,NC] 展开
# 将 RewriteEngine 模式打开
RewriteEngine On
# 修改以下语句中的RewriteBase 后的地址为你的论坛目录地址,如果程序放在根目录中,为 /,如果是相对论坛根目录是其他目录则写为 /{目录名},如:在bbs 目录下,则写为 /bbs
RewriteBase /
# Rewrite 系统规则请勿修改
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(\w+)/([0-9]+)$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^thread-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([a-z]+)-(.+)\.html$ $1.php?rewrite=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule forum-([0-9a-z_]+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
## 保留前面的部分可以不影响已经被搜索引擎收录的页面
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule /([0-9]+)(/([0-9]+))?(/)?$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$5&page=$3&%1 [L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([0-9a-z_]+)(/([0-9]+))?(/)?$ forum.php?mod=forumdisplay&fid=$1&page=$3&%1 [L,NC] 展开
1个回答
2015-11-25
展开全部
location /慎乎 {
rewrite ^.*/files/(.*)$ /宽橡悉wp-includes/ms-files.php?file=$1 last;
if (!-e $request_filename) {
rewrite ^.+?(/wp-.*) $1 last;
rewrite ^.+?(/.*\如野.php)$ $1 last;
rewrite (.*) /index.php last;
}
}
rewrite ^.*/files/(.*)$ /宽橡悉wp-includes/ms-files.php?file=$1 last;
if (!-e $request_filename) {
rewrite ^.+?(/wp-.*) $1 last;
rewrite ^.+?(/.*\如野.php)$ $1 last;
rewrite (.*) /index.php last;
}
}
追问
没有办法解决?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询