Welcome! Log In Create A New Profile

Advanced

Re: Wordpress Permalink Change - Rewrite Wanted

merlin corey
January 12, 2010 07:16PM
On Mon, Jan 11, 2010 at 12: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.

# Nginx side, but would recommend the wordpress plugin instead!
location ~ ^/(.*)/(.*)/(.*)/(.*)/$ {
rewrite ^ /$4 permanent;
}

On Mon, Jan 11, 2010 at 2:41 PM, Ross <ross@thegodlikehobo.org> wrote:
> The following will make Wordpress permalinks work properly, assuming
> it is installed in the webroot.
>
> location / {
> try_files $uri $uri/ /index.php?q=$uri;
> }

Please check out http://wiki.nginx.org/Wordpress for more strategies.

> As for removing the www, you could use something like:
>
> server {
> listen   80;
> server_name  www.domain.tld;
> rewrite ^/(.*) http://domain.tld/$1 permanent;
> }

A better rewrite is:
rewrite ^ http://domain.tld$request_uri permanent;

-- Merlin

_______________________________________________
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: 118
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