Amiagible URLs with form - submit

1

How can I use user-friendly URLs? form - > submit

I already have the friendly URLs made in the .htaccess, they work!

But pressing the SUBMIT button takes me to the normal URL (GET)

http://www.mi.web/stats.php?Jugador=Abcedario

But when putting the direct URL if it works

http://www.mi.web/players/Abcedario

I would like to know how I can do to reedit the SUBMIT to the friendly URL

FORM

<form method="get" action="stats.php">
    <label>Jugador: </label><input type="text" name="Jugador"><br>
<input type="submit" value="Buscar">

.HTACCESS

RewriteEngine on
RewriteRule ^players/(\w+)$ stats.php?Jugador=$1
    
asked by Abcdario 16.11.2017 в 15:00
source

1 answer

0

I leave this example try it like this:

#Aqui lo que se hace es quitar la extension del archivo en este ejemplo es .html

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.html -f
    RewriteRule ^(.*)$ $1.html

#creando reglas de reescritura colocas la url amigable y el archivo que hace referencia
    RewriteRule ^url-amigable-form    file-referencia.php
</IfModule>

and in the form you refer to the "url-friendly-form"

    
answered by 16.11.2017 в 15:15