universally change the path of existing "Link URL"s

Post your Click counter digestion problems here
Post Reply
Rachel
Posts: 2
Joined: Wed Jul 18, 2018 6:55 pm

universally change the path of existing "Link URL"s

Post by Rachel »

Version of script: 2.1.2
Hosting company: AWS :evil:
What terms did you try when SEARCHING for a solution: URL, path, ccount_database.php, domain, change

Hi.
I want to universally change the path of existing "Link URL"s. For example:
Currently entered as https://www.apples.com/seeds.zip
Need https://www.oranges.com/seeds.zip

I tried replacing all https://www.apples.com/ with https://www.oranges.com/ in ccount_database.php (with SublimeText BTW) but this causes all links to disappear from the admin. I know I'm not corrupting the file, because if I use that same replace all back to the original URL, they reappear in the admin.
I also tried doing an export/update/import, but that didn't work either.

What the heck am I missing?

Thanks for your time!
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: universally change the path of existing "Link URL"s

Post by Klemen »

Substituting text in the database works only if both the old and new strings are exactly the same lengths. If not, PHP usnerialize function will fail.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Rachel
Posts: 2
Joined: Wed Jul 18, 2018 6:55 pm

Re: universally change the path of existing "Link URL"s

Post by Rachel »

Ugg.

Thanks!
artist1979
Posts: 1
Joined: Fri Oct 09, 2020 8:48 am

Re: universally change the path of existing "Link URL"s

Post by artist1979 »

I'm trying to change all of my existing links from http: to https: and I'm getting the same error about php unserialize because of the extra s I would imagine then.
Is there a way to change the links quickly or does it mean editing each one manually?
Thanks
P.S. I tried it by editing one of the backups, but I imagine I would have the same problem if I tried to edit the database too.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: universally change the path of existing "Link URL"s

Post by Klemen »

Klemen wrote: Wed Jul 18, 2018 7:21 pm Substituting text in the database works only if both the old and new strings are exactly the same lengths. If not, PHP usnerialize function will fail.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply