容器技术交流

 找回密码
 立即注册
查看: 4010|回复: 3

求助:关于Nginx扩展设置,有图有真相!

[复制链接]
发表于 2011-10-20 14:15:29 | 显示全部楼层 |阅读模式
情况是这样的:我想设置伪静态,所以正常应该在网站根目录下放个.htaccess,然后点选“完全使用Apache处理”吧,如图


或者选前两个,或者三个都选上,结果都会返回500错误,如图



然后我又发现了这块,如图,是不是应该在这里添些什么呢?



请高手指教,以下是我的.htaccess,麻烦告诉我应该怎么处理。或者哪段添在哪块,也可以,谢谢

------------------------------------------------------------------------------------------------------------------------------------------
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^xxxx.com [NC]
RewriteRule ^(.*)$ http://www.xxxx.com/$1 [L,R=301]
ErrorDocument 400/404.html
ErrorDocument 500/404.html
ErrorDocument 401/404.html
ErrorDocument 404/404.html

RewriteRule ^info-id-([0-9]+)\.html$ info\.php\?id=$1
RewriteRule ^info-catid-([0-9]+)\.html$ info\.php\?catid=$1
RewriteRule ^info-catid-([0-9]+)-page-([0-9]+)\.html$ info\.php\?catid=$1&page=$2
RewriteRule ^info-catid-([0-9]+)-areaid-([0-9]+)-page-([0-9]+)\.html$ info\.php\?catid=$1&areaid=$2&page=$3
RewriteRule ^news\.html$ news\.php
RewriteRule ^news-id-([0-9]+)\.html$ news\.php\?id=$1
RewriteRule ^news-catid-([0-9]+)\.html$ news\.php\?catid=$1
RewriteRule ^news-catid-([0-9]+)-page-([0-9]+)\.html$ news\.php\?catid=$1&page=$2
RewriteRule ^corp\.html$ corp\.php
RewriteRule ^corp-areaid-([0-9]+)\.html$ corp\.php\?areaid=$1
RewriteRule ^corp-page-([0-9]+)\.html$ corp\.php\?page=$1
RewriteRule ^corp-catid-([0-9]+)\.html$ corp\.php\?catid=$1
RewriteRule ^corp-areaid-([0-9]+)-page-([0-9]+)\.html$ corp\.php\?areaid=$1&page=$2
RewriteRule ^corp-catid-([0-9]+)-page-([0-9]+)\.html$ corp\.php\?catid=$1&page=$2
RewriteRule ^corp-catid-([0-9]+)-areaid-([0-9]+)\.html$ corp\.php\?catid=$1&areaid=$2
RewriteRule ^corp-catid-([0-9]+)-areaid-([0-9]+)-page-([0-9]+)\.html$ corp\.php\?catid=$1&areaid=$2&page=$3
RewriteRule ^aboutus\.html$ about\.php\?part=aboutus
RewriteRule ^aboutus-id-([0-9]+)\.html$ about\.php\?part=aboutus&id=$1
RewriteRule ^announce\.html$ about\.php\?part=announce&id=$1
RewriteRule ^faq\.html$ about\.php\?part=faq
RewriteRule ^faq-id-([0-9]+)\.html$ about\.php\?part=faq&id=$1
RewriteRule ^friendlink\.html$ about\.php\?part=friendlink
RewriteRule ^space/(.+)\/$ space\.php\?user=$1
RewriteRule ^space/(.+)\/about_us.html$ space\.php\?user=$1&part=about_us
RewriteRule ^space/(.+)\/info.html$ space\.php\?user=$1&part=info
RewriteRule ^space/(.+)\/album.html$ space\.php\?user=$1&part=album
RewriteRule ^space/(.+)\/contactus.html$ space\.php\?user=$1&part=contactus
RewriteRule ^space/(.+)\/comment.html$ space\.php\?user=$1&part=comment
RewriteRule ^space/(.+)\/guestbook.html$ space\.php\?user=$1&part=guestbook
RewriteRule ^space/(.+)\/goods.html$ space\.php\?user=$1&part=goods
RewriteRule ^space/(.+)\/([a-z]+)\/page-([0-9]+).html$ space\.php\?user=$1&part=$2&page=$3
RewriteRule ^space/(.+)\/document-typeid-([0-9]+).html$ space\.php\?user=$1&part=document&typeid=$2
RewriteRule ^space/(.+)\/document-id-([0-9]+).html$ space\.php\?user=$1&part=document&id=$2

-----------------------------------------------------------------------------------------------------------------------------------------------


发表于 2011-10-20 20:18:06 | 显示全部楼层
选第二个就行了,别的不用设置,然后装个discuz,并且它的Apache rewrite规则试一下
 楼主| 发表于 2011-10-21 09:58:50 | 显示全部楼层
爱洞特漏 发表于 2011-10-20 20:18
选第二个就行了,别的不用设置,然后装个discuz,并且它的Apache rewrite规则试一下

谢谢管理,给我提供了一个很好的思路。不过.htaccess还是不好用,那我就转用Nginx,按DZ的Nginx规则测试是可用的,所以我就把.htaccess转换成Nginx,location段和http段还用添东西吗?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|URLOS ( 粤ICP备18087780号 )

GMT+8, 2025-5-15 11:23 , Processed in 0.033274 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表