Question2Answer(Q2A)是十分流行的问答类网站系统,已经应用于2200多个站点,支持包含简体中文在内的33种语言。Question2Answer是基于PHP/Mysql开发的开源程序,可以免费使用,功能也比较丰富。
Q2A在LAMP平台下安装方便,但由于业务需求,我们需要将服务器替换成Nginx,所以就需要对它进行配置。
这里给出我使用的Q2A的Nginx配置文件:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
server { listen 80 default_server; root /srv/www/your_directory/; server_name your_domain.com www.your_domain.com; location / { index index.php index.html index.htm; if (!-f $request_filename) { rewrite ^/(.+)?$ /index.php?qa-rewrite=$1 last; } } location /index { rewrite ^/index/([^/]+)/([^/]+)/([^/]+) /index.php?qa=$1&qa_1=$2; } } |
暂无评论