Multiple links update

Hi,


Our matrix runs approx 80 sites, in the very near future we are launching a new commerce system, therefore we need to update the links to now go the the new process. Each site has apporx 2 links, so thats 160 url's to update. Is there some sort of find and replace function on the system, or even better, is there a way we can connect directly to the db and change the information there?



The links are hardcoded within the body, if we can change this information via the db, where would we find that data?



Oh and just in case, we're running version 3.20.3.



Many thanks.



Farhad

Do all the links point at a single asset, or is the URL hard-coded?


Either way there are options, but as you mentioned, you might need to change the links in the DB.

Hi Daniel,


All the links are hard-coded on to a standard page, they're part of the content of the site. All the links go to a commerce system outside of the matrix.



Below is a snippet of the code/URL that we are looking to change.





[codebox]

<htmlarea_form onsubmit="return checkform(this);" action="https://secure.informatrading.com/COD/CHIPS/REGISTER/Default.asp?id=XXXX&tc_tick=true" target="_blank">

<input value="XXXX" name="brand" type="hidden" />

<input value="XXXX" name="id" type="hidden" />

<label for="tc_tick">I have read and agree to the terms and conditions:</label>

<input value="true" name="tc_tick" type="checkbox" />

<input value="Continue to booking form" type="submit" />

</htmlarea_form>

[/codebox]



The bold line is what we would like to replace.



Thanks

You'll have to do that in the database, something like this (assuming you fully test this in a non-production environment) should do the trick:

    UPDATE sq_ast_attr_val
    SET custom_val = REPLACE (custom_val, 'href="http://example.com"','href="http://new.example.com/"')
    WHERE custom_val LIKE '%example.com%';

Hi Daniel - we will give that a go, thanks very much. :slight_smile: