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.
Get Involved
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 » Tue Dec 30, 2014 1:53 pm

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 » Tue Dec 30, 2014 9:29 pm

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 » Thu Jan 01, 2015 9:00 am

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 » Thu Jan 01, 2015 9:25 am

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 » Thu Jan 01, 2015 2:02 pm

I think I found the solution.
http://www.geohei.lu/geoheiWP/?p=129
Cu, geohei

User avatar
Lumpy Burgertushie
Registered User
Posts: 65524
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Change URLs

Post by Lumpy Burgertushie » Thu Jan 01, 2015 4:36 pm

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
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

Locked

Return to “[3.0.x] Support Forum”

Who is online

Users browsing this forum: Feneck91, Google [Bot], oshawapilot, twm49 and 56 guests

cron