nginx和joolma的rewrite配置

今天装了php,并且安装了joolma来学习,不过在joolma里面发布文章的时候,发现新文章找不到,都是404,看了一下文件的链接,都是这样的
http://192.168.253.131/index.php/joomlaville-overview
怀疑是rewrite规则的问题,网上找了一下看到
http://www.joomlagate.com/forum/topic-46226/
还有官方的文档
http://docs.joomla.org/Nginx

我只添加了try_files $uri $uri/ /index.php?q=$uri&$args;这一句就ok了
不过其他的官方配置也可以参考哦,呵呵

server {
        listen       80;
        server_name  localhost;
	rewrite_log on;
        #charset koi8-r;
	root   html;
	index index.php;
        #access_log  logs/host.access.log  main;

        location / {            
            #index  index.php index.html index.htm;
	    try_files $uri $uri/ /index.php?q=$uri&$args;
        }
	location ~ \.php$ {
            root html;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
            include fastcgi_params;
       } 

猜你喜欢

转载自zjnbshifox.iteye.com/blog/1741774