0
votes

Im struggling with this problem for 3 days since i dont know any coding or regex of etc

i have a wp streaming site with iframe content, the iframe source already in https

now i want to migrate my streaming site to https but when i try to do that, there a lot of movies that cant play, and after i checked, the problem is the iframe url

The movies works ok if the iframe has trailing slash https://example.com/embed/pMVg9liYw9gTvL7/

but without trailing slash, the movies wont load https://example.com/embed/pMVg9liYw9gTvL7

What i want to achieve is to add trailing slash at the end of iframe url from mysql.

please help Thanks

2
Welcome to StackOverflow! In order for us to help you better, can you please update your question so that it shows your relevant code in a minimal, complete, and verifiable example. It would also be helpful if you could let us know what you have tried so far to solve your problem. For further information, please refer to the help article regarding how to ask good questions, and take the tour of the site :) - Obsidian Age
Use concat(url, '/') in your select statement. - jose_bacoy
hi thanks for the replycan u please explain how to ? thanks - Caroline Wirawan
Can you show your table design ? What columns does it have? What field stores the URL ?? - stackFan
hi again, the table is wp_postmeta, metakey repeatable_fields, and this is inside meta value a:1:{i:0;a:4:{s:4:"name";s:8:"Server 1";s:6:"select";s:6:"iframe";s:6:"idioma";s:0:"";s:3:"url";s:45:"klikfilm.stream/embed/eprN0P0NMh9E6PP";}} - Caroline Wirawan

2 Answers

3
votes

I usually don't like to answer questions that show no attempt, but this one is so simple that it's easier to answer than post complaints.

Use a simple UPDATE statement.

UPDATE yourTable
SET url = CONCAT(url, '/')
WHERE RIGHT(url, 1) != '/'

Replace yourTable and url with the name of your table and the column holding the iframe URL than needs to be fixed.

-2
votes

I need to achieve a similar thing. I just changed the url structure of a website from non-slash ending urls to shalsh ending urls.

There's a lot of internal linking and I would like to change all those urls to have a slash at the end "/" instead of using a 301 redirect.

Any ideas how to achieve this via sql query/queries?

Thanks to anyone taking time to help!