Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2016-10-23 16:19:18

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,730
Website

Re: moved urls - any advice?

Jsut a reminder: for the map, you’ll need to generate it from the database with the old ids. I would do that for the texts section separately:

<txp:article_custom limit="2000" section="texts" break="" wraptag="" sort="id asc">
<txp:article_id />   <txp:permlink />
</txp:article_custom>

Then show the page source and copy that into your text editor (I do it with the page source to avoid getting any markup in there or html shortening things like spaces or tabs). Then do a search and replace on all the urls to make the permlinks match the new destination url. Most text editors have a switchable regex option in the find/change box that will allow you to search for something like /\d{1,} and replace it with nothing, so that you can remove the ids from the destination urls.

If you plan on including the news articles in the rewritemap, repeat the process but for the news section. Finally combine the two text files into one.


TXP Builders – finely-crafted code, design and txp

Offline

#14 2016-10-23 16:32:18

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

Re: moved urls - any advice?

jakob wrote #302423:

Jsut a reminder: for the map, you’ll need to generate it from the database with the old ids. I would do that for the texts section separately:

Indeed it is what I did.

I’ll be posting here all my steps as these methods are new to me.

I created the newmap.txt (86KB) file and uploaded it to the main domain.
To create the dbm hash file described here I’ve run the following in the terminal.

httxt2dbm -i /home/xx/webapps/xxx/newmap.txt -o /home/xx/webapps/xxx/newmap.map 

but instead of a .map file I got newmap.map.dir (4kb) and newmap.map.pag (524KB) as indeed is described in the page.

The next step should be to add the directive in the htaccess file and according to the link above it should be: RewriteMap mapname "dbm:/home/xx/webapps/xxx/newmap.map" but this currently returns a 500 error.

Hmmm. Do I need to change mapname with the name of the map? It still returns a 500.

Last edited by colak (2016-10-23 17:12:55)


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

Offline

#15 2016-10-23 17:46:11

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

Re: moved urls - any advice?

A quick solution for the 404s until I figure it out: on github. Visitors are more important than satisfying google.


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

Offline

Board footer

Powered by FluxBB