A
A
Antony2017-11-02 20:23:55
Joomla
Antony, 2017-11-02 20:23:55

How to bulk change the url on the site?

Hello. The problem is this. There is a site. One for WP, one for Joomla. There was a need to replace urls from the type site.com to urls like site.com/ru
There are hundreds of pages on the site. Do not do it by hand. Tell me how to do it easier?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2017-11-02
@Stalker_RED

in files:

grep -rl 'apples' /dir_to_search_under | xargs sed -i 's/apples/oranges/g'

in base:
UPDATE your_table
  SET your_field = REPLACE(your_field, 'apples', 'oranges')
  WHERE your_field LIKE '%apples%'

If it is expected that they may be in unexpected places in the database, then you can export the database to a .sql file, make a replacement in it, and upload it back.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question