Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Jan 11, 2010 4:37 pm 
Offline
Senior Newbie

Joined: Sat Jan 09, 2010 5:32 pm
Posts: 5
Website: http://mswhs.com
Location: UK
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. Heres a copy of my existing file:
Code:
server {
            listen   80;
            server_name  www.servinghomeserver.com;
            rewrite ^/(.*) http://servinghomeserver.com/$1 permanent;
       }

server {
            listen   80;
            server_name servinghomeserver.com;
            access_log /home/public_html/servinghomeserver.com/log/access.log;
            error_log /home/public_html/servinghomeserver.com/log/error.log;

            location /  {
                        root   /home/public_html/servinghomeserver.com/public/;
                        index  index.php index.html;                     
                        }

            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            location ~ \.php$
                     {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include /usr/local/nginx/conf/fastcgi_params;
            fastcgi_param SCRIPT_FILENAME /home/public_html/waywiderweb.com/public/$fastcgi_script_name;
                        }
       }

I want to keep the existing code in there where www requests go straight to http - Please help and thanks in advance.


Top
   
 Post subject:
PostPosted: Mon Jan 11, 2010 6:24 pm 
Offline
Junior Member

Joined: Tue Jan 01, 2008 4:28 am
Posts: 32
Or just use this plugin:

http://scott.yang.id.au/code/permalink-redirect/

After installing it, in Settings -> Permalink Redirect, under "Old Permalink Structures", put

/%year%/%monthnum%/%day%/%postname%/

in there. "Update Options" and you are set. It basically catches any 404 and then tries to compare whether it matches any old permalink structure and then redirect you to the new URL.

Disclaimer: yup I wrote that WP plugin.


Top
   
 Post subject:
PostPosted: Mon Jan 11, 2010 6:54 pm 
Offline
Senior Newbie

Joined: Sat Jan 09, 2010 5:32 pm
Posts: 5
Website: http://mswhs.com
Location: UK
Thanks Scotty - So is this ok for SEO purposes it passes a 301 redirect I persume?


Top
   
 Post subject:
PostPosted: Wed Jan 13, 2010 8:28 am 
Offline
Senior Member
User avatar

Joined: Tue Dec 01, 2009 10:31 pm
Posts: 57
G'Day PTC,
I got this one going by following guvnr's guide here.


Top
   
 Post subject:
PostPosted: Wed Jan 13, 2010 4:23 pm 
Offline
Senior Newbie

Joined: Sat Jan 09, 2010 5:32 pm
Posts: 5
Website: http://mswhs.com
Location: UK
Thanks Moses - I have followed the guide (excellent, I must say), but the Guvnr's guide only covers having permalinks enabled NOT directing old format to new (e.g. /%year%/%monthnum%/%day%/%postname%/ to /%postname%/ ) as a 301 redirect thats ok for SEO purposes. Thats why i wondered if the Permalink Redirect plugin Scotty mentioned was ok for SEO purposes? :?:


Top
   
 Post subject:
PostPosted: Thu Jan 14, 2010 7:23 am 
Offline
Junior Member

Joined: Tue Jan 01, 2008 4:28 am
Posts: 32
PhillTheChill wrote:
So is this ok for SEO purposes it passes a 301 redirect I persume?


Yup. That's the whole point. It has been tested under Apache and Nginx and should throw 301 to redirect the clients to the new permalink.


Top
   
 Post subject:
PostPosted: Thu Jan 14, 2010 1:00 pm 
Offline
Senior Newbie

Joined: Sat Jan 09, 2010 5:32 pm
Posts: 5
Website: http://mswhs.com
Location: UK
Thanks Scotty. One other thing can you update your plugin so I can redirect feedburner to using feedburner with my own domain eg. http://feeds.mswhs.com/mswhs


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group