how to make a title friendly url

1

How do friendly URLs that take the title like the image link work? because in the index of the site the normal would be musica.php?id=<?php echo $row['id'];?> , how to get the title of each post and transform into a friendly url? And in case the check would do so select * from musicas where titulo = $titulo would it be more or less that?

    
asked by anonymous 01.03.2018 / 09:21

2 answers

0

Friendly urls are generated thanks to an apache configuration, usually placed inside a .htaccess file, there is a lot of content about it out there, there is a link that might help you. Friendly URL in PHP

    
01.03.2018 / 13:13
0

You can create this url with the title of your theme. Here's a posted response from the OS that does this.

Example usage:

$meu_titulo='Música do Wesley Safadão';

$url_amigavel = slugify($meu_titulo);

echo$url_amigavel; //imprime musica-do-wesley-safadao
    
01.03.2018 / 15:32