1
I am working with site friendly Urls developed in PHP. I created the file . htaccess and did the appropriate redirects according to my needs. For example, the page named.com/contact.php is now named.com/contact . So far so good. Now I have a page called noticias.php that brings several news to the user. When you click on a certain news, it is called the file mostranoticia.php? id=2 (for example id of the news 2) and the news is displayed. I want to make sure that when I click on the news, its url is named.com/mostranoticia/nome-da-noticia-selecionada/4. How can I create a rule for this and how is the link in href="" of my code?
My doubt is the syntax of the regular expression and how to make the name stay in the url, since I have the name saved in the database and the name of the news has spaces between the words and the url I cannot have these spaces.
Post an example of what you’ve done to improve understanding.
– Gabriel Rodrigues