I'm doing my TCC and the theme is SEO, to complete I need to put friendly URL since the current link is like this:
post.php? id = 79
Well, I already looked for the .htaccess and managed to leave the main pages (blog.php, contato.php, index.php and sobremim.php) friendly but the ones that are the posts and are recovered from the bank I can not, I would like help.
.htaccess code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^contato/?$ contato.php [NC,L]
RewriteRule ^blog/?$ blog.php [NC,L]
RewriteRule ^sobremim/?$ sobremim.php [NC,L]
RewriteRule ^inicio/?$ index.php [NC,L]
</IfModule>
Schedule you are looking for at the bank:
<?php
$mysql = new BancodeDados();
$mysql->conecta();
$ident = $_GET['id'];
//$query = mysqli_query($mysql->con,"select * from postagens where id = $ident");
$query = "SELECT * from postagens where id = $ident";
// executa a query e 'grava' o resultado em $res
$res = mysql_query($query) or die(mysql_error());
// busca os campos da query
$campo = mysql_fetch_array($res);
// armazena cada campo do banco em uma variável
$tit = $campo["titulo"];
$subt = $campo["subtitulo"];
$textinho = $campo["conteudo"];
$imge = $campo["foto"];
$categ = $campo["categoria"];
?>
<img class="card-img-top" src="admin/img/<?php echo $imge;?>">
<div class="card-body">
<h1><?php echo $tit ;?></h1>
<h2><?php echo $subt ;?></h2>
<p class="card-text"><?php echo $textinho ;?></p>
</div>
<br><br>
<hr>