Url Friendly Wordpress

1

I would like to define a custom url in .htaccess , in wordpress it comes by default like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On<br>
RewriteBase /sistema/<br>
RewriteRule ^index\.php$ - [L]<br>
RewriteCond %{REQUEST_FILENAME} !-f<br>
RewriteCond %{REQUEST_FILENAME} !-d<br>
RewriteRule . /sistema/index.php [L]<br>
</IfModule>
# END WordPress

When I add this

RewriteRule ^(.*)$ single-perfil.php?amigable=$1
  

What I want to achieve is that, that template single-profile.php receives the   variable (url_amigale).

I must mention that I have a system of people, where in the person table I have a field that says url_amigale I understand that this variable to send would be this friendly = $ 1

when I call the single-profile.php file, I do so

This works for me without using wordpress, but in wordpress it does not work for me and it leaves page not found 404

I want to do this so as not to be creating a post for each person, if not just use a template and the friendly url will come out like this, with the variable that will be received in this case (url_amigable):

mipagina.com/joseperez

Thanks

    
asked by Jorge 10.07.2018 в 19:27
source

1 answer

1

It is not necessary for you to make that file, Wordpress can generate it automatically.

What you have to do is:

ajustes>enlaces permanentes>ajustes comunes > [Seleccionar] Nombre de la entrada

Click on save changes

And you are ready, you will have the opportunity to use friendly URLs in a very simple way since the page will take the name of the page according to the menu in which it is.

    
answered by 11.07.2018 в 00:42