Welcome! Log In Create A New Profile

Advanced

Re: Wordpress Permalink Change - Rewrite Wanted

Ross
January 11, 2010 05:48PM
On Mon, Jan 11, 2010 at 3:13 PM, Philip Churchill
<philip@churchilluk.co.uk> wrote:
> I have changed my Wordpress permalink structure from:
>
> /%year%/%monthnum%/%day%/%postname%/
>
> TO
>
> /%postname%/
>
> But i'm not sure what to put in my nginx config file for the old links to be
> re-directed to the new ones. I would also like any www requests to go to
> http only also
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
>

The following will make Wordpress permalinks work properly, assuming
it is installed in the webroot.

location / {
try_files $uri $uri/ /index.php?q=$uri;
}

And if you're concerned about SEO, checkout the nginx-compatibility
plugin. When the old permalinks are accessed, it'll cause Wordpress to
redirect to the new ones with a 301 (moved permanently) instead of the
less SEO-friendly 302 (found).

As for removing the www, you could use something like:

server {
listen 80;
server_name www.domain.tld;
rewrite ^/(.*) http://domain.tld/$1 permanent;
}

-Ross

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Wordpress Permalink Change - Rewrite Wanted

PhillTheChill January 11, 2010 03:16PM

Re: Wordpress Permalink Change - Rewrite Wanted

Ross January 11, 2010 05:48PM

Re: Wordpress Permalink Change - Rewrite Wanted

merlin corey January 12, 2010 07:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 95
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready