I produced two pages

alice.php and bob.php

code for alice.php

<?php
echo "This is alice page";
?>

<form name="sdlflks" method="get" action="bob.php">
<input type="text" name="t1">
<input type="submit" name="submit">
</form>

code for bob.php

<?php
echo "This is bob page";
echo "<br>" . $_GET['t1'];
?>

I entered into the alice page as helloworld, it redirects to bob.php within this url format http://localhost/test1/bob.php?t1=helloworld&submit=Submit

rather i must appear as

http://localhost/test1/bob.php/helloworld

or

http://localhost/test1/bob/helloworld

I researched plus some articles, answer right here but tend to not get that one.

As well as produced b .htacces.conf within the same directory as "test1"

Inshtaccess.conf

i added this experssion for mod_rewrite

RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ bob.php?t1=$1&submit=$2 [L]

Can any tell me, who i accomplish this. And where must i add this expression by which type of code or perhaps in which module should i put this.

By only using mod_rewrite you'll only get so far as:

http://localhost/test1/bob?t1=helloworld&submit=Submit

Like the HTML form submission happens in the browser and automatically it appends the GET parameters as pairs, separated by ampersand.

If you actually need the shape submittion to finish up at:

http://localhost/test1/bob/helloworld

you will find 2 solutions:

  • submit using javascript. Meaning you'll capture the submit and just send the consumer towards the URL above
  • submit normally and out of your php script imediatelly perform a redirect towards the URL above to complete the experience within the "pretty" URL