Wordpress Permalinks
Edho Arief
edho at myconan.net
Thu Feb 16 23:44:18 UTC 2012
On Fri, Feb 17, 2012 at 6:10 AM, justin <nginx-forum at nginx.us> wrote:
> Howdy.
>
> So I am trying to get permalinks to work with Wordpress. I have read a
> few articles/blog posts but still no luck. The permalink structure I am
> trying to use is:
>
> http://mydomain.com/wp/index.php/2012/02/sample-post/
>
I believe it's easier to use this structure:
http://mydomain.com/wp/2012/02/sample-post/
(I don't know why wordpress doesn't offer this form for nginx by default)
Anyway, you need to move try_files outside location ~ \.php$ block.
You also need split path info (and remove $ to match
/wp/index.php/2012/02/sample-post/) or add one more location block to
specifically handle the url.
> Here is the configuration block that I am currently using that is
> important:
>
> # permalinks currently not working with this
> location ~ \.php$ {
> include /etc/nginx/fastcgi_params;
> fastcgi_intercept_errors off;
> fastcgi_index index.php;
>
> try_files $uri $uri/ /index.php?q=$uri&$args;
>
> # tried this as well, but still doesn't work
> #
> #if (!-e $request_filename) {
> # rewrite ^.*$ /index.php last;
> #}
>
> fastcgi_pass php1.local.mydomain.com:9000;
> }
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,222511,222511#msg-222511
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
More information about the nginx
mailing list