WordPress.org

Ready to get started?Download WordPress

Forums

Updated Permalink Structure - Anyway to salvage Google rank of previous URLs? (8 posts)

  1. LearnWebCode
    Member
    Posted 4 years ago #

    Hi everyone,

    I realize now that changing your permalink structure once you have any amount of content on your WordPress site is a bad idea, simply because your old URLs will still be in Google, and many potential visitors will only see a 404 instead of the desired post.

    This is the boat I'm in. Is there anyway to achieve either of the following:

    1) Create secondary permalinks for each post, so that if someone from Google visited the outdated permalink structure it would still load the post.

    2) Somehow notify Google's search engine to refresh it's listings of my site.

    Is this not that big of a deal? Will Google hopefully update my links in related searches sometime soon? I updated my permalink stucture a few weeks ago, but no luck yet.

    Thanks!

  2. How did you change them? I mean, if it's from ugly permalinks to pretty, they SHOULD auto-redirect. But you're saying you get 404s, so it MAY be possible to set up an htaccess redirect to take care of it for you.

    What are the before and after urls?

  3. Mandy
    Member
    Posted 4 years ago #

    Hi, sorry for interrupting this discussion but I have exactly the same question. My url structure:
    old: domain.com/blog/postTitle-postID/
    new: domain.com/es/blog/postTitle/
    Is there any way to create a rule for the redirection?

    Thanks!!

  4. LearnWebCode
    Member
    Posted 4 years ago #

    Hi Ipstenu,

    This was my original structure:
    http://my-site.com/year/month/day/this-is-the-title/

    And I changed it to this:
    http://my-site.com/this-is-the-title/

    However, I also did something that I realize now was foolish.

    Many of my posts were titled "XHTML Lesson 1: title subject" or some other lesson # and subject. I didn't want "xhtml-lesson-#" in every URL (because I read that shorter, to the point URLs are more effective) so I edited the permalinks to just contain the subject/title of the post.

    I don't have that many posts yet, so perhaps I could set up a manual / hardcoded htaccess redirect for the 10 or so posts that are effected by this? I'll search around for a htaccess guide.

    Thanks!

  5. Mark / t31os
    Moderator
    Posted 4 years ago #

    You might find a redirect facility in your web hosts control panel, it'll speed up the process, and shouldn't mess with your htaccess file..

    I have cPanel with my host, and i've always setup standard 301 redirects from cPanel without causing a problem.

    Alternative is write them by hand, which i can do myself, but i see little point when cPanel offers to do the work for me.

    Should be given 2 boxes, the URL to match, and the new one to send it to.. that simple, it'll do the coding and updating the htaccess for you.

  6. @LearnWebCode

    http://my-site.com/this-is-the-title/ is a bad URL structure in general, because one day you might have the same URL. It could happen.

    Personally I do the redirects by hand, based on my error log, and put them into my .htaccess, but I have no htaccess fears so. You could do something like this...
    RewriteRule ^([0-9][0-9][0-9][0-9])/([0-9][0-9])/([0-9][0-9])/$ /$1

    You can get more ideas from here: http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html

    mafalda1426

    I would try this:
    RewriteRule ^blog/$-([0-9][0-9]) /es/blog/$1

    But I'm less certain about that one...

  7. Mark / t31os
    Moderator
    Posted 4 years ago #

    I don't have htaccess fears either.. :p i was just talking about simplicity...

    I'd personally do the rewrite regex a little different.. ;)

    Instead of..

    ([0-9][0-9][0-9][0-9])

    I'd use..

    ([0-9]{4})

    Same with this..

    ([0-9][0-9])

    ..

    ([0-9]{2})

    :)

    ...not that it's hugely important, but i believe this method will actually be faster for apache to process to.

  8. Good point about the regexp (I always get confused who uses which and what).

    Also I actually find it way easier to use htaccess than Cpanel. Too many options ;)

Topic Closed

This topic has been closed to new replies.

About this Topic