Page 1 of 1

Brocken internal links in posts

Posted: Thu Jan 18, 2018 10:30 am
by PELP
I am admin for a Danish board, dfac.dk/fritforum. I have a serious, probably self inflicted, problem with brocken, internal links in posts that I hope there is a simple solution for.

Until recently we ran our forrum as a subdomain ie. fritforum.dfac.dk. I have upgraded to php 7.0, phpbb 3.2 and implemented SSL. To get SSL to work, i found it necessary to change the main link to https://dfac.dk/fritforum and by adding a redirect to .htaccess I got all variations of fritforum.dfac.dk and dfac.dk/fritforum to work as the main URL. So far so good.

Now I have found a problem that I think I know the reason for, but I can´t find a quick fix. All internal links in posts are brocken and just lead to the boards home page. I think the reason is, that when people post and want to link to some other post on the board, they just type or copy the URL without using the link bbcode. Alle internal links to uploaded dokuments, pictures and so on, have automatically been changed, but the direct links in posts have not been, and the redirect obviously doesn´t solve this. So now I have almost 16000 posts with potentially brocken links. HELP please.

Re: Brocken internal links in posts

Posted: Thu Jan 18, 2018 11:31 am
by janus_zonstraal
All internal links in posts are brocken and just lead to the boards home page. I think the reason is, that when people post and want to link to some other post on the board, they just type or copy the URL without using the link bbcode.
If that is the reason, I think the best way is to copy your board and database.
En try a search and replace on the test database on the old url

If it is working you can do it on your live board.

Re: Brocken internal links in posts

Posted: Fri Jan 19, 2018 10:38 am
by PELP
Thanks for the reply Janus. I hadn´t seen your reply before I tried that solution, and it worked.

I loaded a copy of the database into Wordpad and did a "search and replace" - first for 'fritforum.dfac.dk' to 'dfac.dk/fritforum' and then for 'http://dfac' to 'https://dfac'. The first one alone was not enough, but after the second run it worked.