Htaccess mod_rewrite Shorten SEO-Enabled URL

I have this address

http://www.nfrases.com/tag.php?id_tag=10&id_frase=508 

that I would like to make it much shorter and more optimistic for SEO, for example (I don’t know ... open to suggestions) http://www.nfrases.com/tag/10/508 or http://www.tag10name.nfrases.com/508

I need help on how to code this, because a simple thing, like trying to make an address is always http://www.nfrases.com when a user goes to http://nfrases.com or www.nfrases.com I tried and did not execute: (

This code is used, by the way:

 Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} !^www.nfrases.com$ RewriteRule ^(.*)$ http://www.nfrases.com/$1 [R=301] 
+4
source share
1 answer

http://www.nfrases.com/tag.php?id_tag=10&id_frase=508

becomes

http://www.nfrases.com/10/508

with this in your .htaccess

 Options +FollowSymlinks -MultiViews RewriteEngine On RewriteRule ^([0-9]*)/(.*)/?$ /tag.php?id_tag=$1&id_frase=$2 [L,QSA] 

untested. Let me know if this works for you.

+5
source

All Articles