How to use friendly urls in a php system? [duplicate]

1

I'm working on a website, the first site I do without Wordpress and would like your help to implement friendly urls. I do not have much knowledge on friendly urls and .htaccess but I'm trying to learn. My initial .htacces is this:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteBase /
RewriteRule ^(.*)$ index.php/$1 [L]

I want to make a post and I do not want to return something like:

/artigos/eu-quero-aprender-como-funciona-htaccess

Question: Do I have to make a script that already sends the friendly url to the bank?

Question 2 : Can you please show me how to get the url quoted above through .htaccess ? It would be a basis for me to continue the system .

Sorry if my question does not have as many details or if I seem to be asking to do it for me. It's not about that.

    
asked by anonymous 10.11.2015 / 16:30

1 answer

2

Question 1: Do I have to do a script that already sends the friendly URL to the bank?

Do not need to, but if you do not do this you will have a greater effort to search your database, I indicate already register the post in the database with the path. Wordpress does this.

Question 2: Can you please show me how to get the url quoted above through .htaccess? It would be a basis for me to continue the system.

RewriteRule ^artigos/(.*) artigos.php?qualartigo=$1

Options +FollowSymLinks
RewriteEngine On
    
10.11.2015 / 17:38