Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-11-01 08:18:18

khorramirad
Member
From: Iran
Registered: 2009-12-12
Posts: 11
Website

messy URLs to clean URLs migration question

I’m planning to turn my messy links into clean URLs, because of the SEO considerations.
My website has been up for about 7 years, with about 900 articles, they have a very good visibility in Google, and I don’t want to lose anything here.

My clean URLs work like this:
  • 1txp- All the URLs are shown clear in the website. When I click on them, well, they open! No problem here.
  • 2txp- If I try to open one of the old messy links, they also open, but with the same old link.
The same thing in a WordPress test website works like this:
  • 1wp – similar to 1txp
  • 2wp – when I try to open the old messy link, it redirects to the new URL, and then opens.

So, the difference here is that in WordPress, some kind of redirecting happens, while TextPattern does not do that. I suspect that in my case (TextPattern) there would be a duplicate of the same content and old ranking information would not be transferred to the new clean URLs, while WordPress is not like that. It seems like wp’s choice is much more SEO friendly than txp’s.

Now, I’m not a professional at all of these, but I’ve learned about htaccess syntax a little, and when I compare wp htaccess and txp htaccess, I see that they are exactly the same; they check to see if the URI is addressing a file or directory, and otherwise, they pass it to the Index.php. So, it seems to me that the difference is about the way Index.php works differently in wp and txp. Am I right?

Is there any way I can set txp to redirect the old URLs into the new ones, like wp?

thanks

Offline

#2 2013-11-01 08:50:50

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

Re: messy URLs to clean URLs migration question

Hi Nader

zem_redirect should fix the problem. The plugin can be copied/pasted from the first post.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2013-11-01 08:58:28

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: messy URLs to clean URLs migration question

Add canonical link to your page’s head and you are set. Search engines will then drop the old URL from their index and known that the two pages are the same. Along the lines of:

<txp:if_individual_article>
    <link rel="canonical" href="<txp:permlink />"/>
<txp:else />
    <txp:if_category>
        <link rel="canonical" href="<txp:category url="1" />"/>
    <txp:else />
        <link rel="canonical" href="<txp:section url="1" />"/>
    </txp:if_category>
</txp:if_inidividual_article>

You may also want to restrict indexing of search results pages (via robots.txt etc) and probably paginated pages, and any tag clouds and probably category pages too.

For redirects there are plugins such as aks_header, or you could use simple htaccess redirect rules.

khorramirad wrote:

2txp- If I try to open one of the old messy links, they also open, but with the same old link.

Unlike most systems, Textpattern doesn’t use views model (where content is given to the template by the applicatin). In other words, we have absolutely no clue what content your pages will display or where it belongs. Your templates itself are fetching the content, and we can not know what URL is real and which is not. We could do some hard exceptions and redirect based on params to the clean scheme, but we don’t know whether the destination will be valid.

Offline

#4 2013-11-01 20:29:24

khorramirad
Member
From: Iran
Registered: 2009-12-12
Posts: 11
Website

Re: messy URLs to clean URLs migration question

Really great help Gocom, thanks.
Thanks Colak.

Offline

Board footer

Powered by FluxBB