How to use friendly urls on a php system?

Asked

Viewed 87 times

1

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

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

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

I want to do a post and I don’t want to return something like:

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

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

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

I’m sorry if my question doesn’t have as many details or if I seem to be asking you to do it for me. It’s not about that.

  • 3

    I have the impression that I’ve seen about 3 such questions on this site

1 answer

2

Question 1: I have to make a script that already sends the user URL to the bank?

No need, but if not you will have a greater effort to search in 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 above mentioned url through . htaccess? It would be a basis for me to continue the system.

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

Options +FollowSymLinks
RewriteEngine On

Browser other questions tagged

You are not signed in. Login or sign up in order to post.