Change URLs

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
User avatar
geohei
Registered User
Posts: 163
Joined: Sat Jan 04, 2003 1:21 pm

Change URLs

Post by geohei »

Hi.

I use 3.0.12.

I have many links with files which I referenced to a download directory.
E.g. http://www.mysite.com/downloads/file.zip

I need to change all links (which are spread all over all threads) to a new domain.
E.g. http://www.newdomain.com/downloads/file.zip

- Is some kind of buld operation possible (build-in, plugin, ...)?
- What is the easiest was to get there?

Thanks,
Cu, geohei
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Change URLs

Post by Oyabun1 »

URLs in posts may have been added as magic URLs or using BBCode tags.

Magic URLs, those the software makes clickable without BBCode tags, are stored like:

Code: Select all

http://www.old_example.com 
Those that were entered using the [url][/url] BBCode are stored like:

Code: Select all

http://www.old_example.com
Certain characters are encoded as HTML entities. The colon : is encoded as : and the full stop . is encoded as ..

These queries will change both types:

Code: Select all

UPDATE phpbb_posts SET post_text = REPLACE(post_text, 'www.old_example.com', 'www.new_example.com');
UPDATE phpbb_posts SET post_text = REPLACE(post_text, 'www.old_example.com', 'www.new_example.com'); 
Change the table prefix if yours is not phpbb_, and the names of the old and new domains. For the second query make sure you maintain the syntax by using HTML entities as appropriate.

It will probably then be necessary to install the Support Toolkit and run the Reparse BBCode tool.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
geohei
Registered User
Posts: 163
Joined: Sat Jan 04, 2003 1:21 pm

Re: Change URLs

Post by geohei »

Thanks a lot!

What about some .htaccess tweaking inside the downloads directory?

Is this possibly easier i.s.o. modifying every posting?

Thanks,
Cu, geohei
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Change URLs

Post by Oyabun1 »

Maybe, I have no idea how to do that though. Also, it would not change the displayed links in a post only the target.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
geohei
Registered User
Posts: 163
Joined: Sat Jan 04, 2003 1:21 pm

Re: Change URLs

Post by geohei »

I think I found the solution.
http://www.geohei.lu/geoheiWP/?p=129
Cu, geohei
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Change URLs

Post by Lumpy Burgertushie »

that may or may not work correctly for you. however it will not change the links in the posts.

why not do it the proper way as bill showed you. it won't take but a few seconds.


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
Locked

Return to “[3.0.x] Support Forum”