XF 2.2 Bad links from threads in resources

Allan

Well-known member
Hello,

I have restored an old database from a previous installation. I changed the domain name example.com to example.net

After the update, all the links seem to work correctly except the links created in the first message of the discussions created automatically when adding a resource.

Example: https://xenforo.com/community/threads/redis-cache-by-xon.132179/

bad link.webp

Do you have any idea how to fix these links?
 
As I explained in your ticket, you can implement redirection, or update the URLs in the posts using the post content replace add-on.

You can also run a simple query against the database directly to update domains:
UPDATE xf_post SET message = REPLACE(message, 'http://www.example', 'https://another-domain');
 
I use this query:
'UPDATE xf_post SET message = REPLACE(message, 'http://xenfrench.com', 'https://xenfrench.net');

But i have this error:

Erreur​

Analyse statique :

10 erreurs trouvées lors de l'analyse.



  1. Un guillemet ' était attendu. (near "" at position 97)
  2. Début d'énoncé inattendu. (near "'UPDATE xf_post SET message = REPLACE(message, '" at position 0)
  3. Début d'énoncé inattendu. (near "http:" at position 48)
  4. Début d'énoncé inattendu. (near "xenfrench" at position 55)
  5. Début d'énoncé inattendu. (near "com" at position 65)
  6. Début d'énoncé inattendu. (near "', '" at position 68)
  7. Début d'énoncé inattendu. (near "https:" at position 72)
  8. Début d'énoncé inattendu. (near "xenfrench" at position 80)
  9. Début d'énoncé inattendu. (near "net" at position 90)
  10. Début d'énoncé inattendu. (near "');;" at position 93)


Requête SQL : Copier

'UPDATE xf_post SET message = REPLACE(message, 'http://xenfrench.com', 'https://xenfrench.net');;

MySQL a répondu : Documentation

#1064 - Erreur de syntaxe près de ''UPDATE xf_post SET message = REPLACE(message, 'http://xenfrench.com', 'https...' à la ligne 1
 
Remove the ' from the beginning:
UPDATE xf_post SET message = REPLACE(message, 'http://xenfrench.com', 'https://xenfrench.net');
 
Solution
Back
Top Bottom