I have a small project to do in the next few days and my client has a cheap, shared hosting that does not allow me to change apache settings and is not mod_rewrite enabled. I would like to find another way to keep URLs friendly and I'm thinking of architecting an environment where:
http://www.meucliente.com/action/param1/param2/
is replaced by:
http://www.meucliente.com/?/action/param1/param2/
Notice the question mark before /action
.
From this, index.php
will read the superglobal $_SERVER['QUERY_STRING']
to decide what to do. Even a form with POST
would be sent to an address that looks like GET
<form action="/?/form-action/" method="POST">...</form>
Here comes the real question: in your opinion, dear experienced developers, does this look a lot like gambiarra? is there another more elegant way to make the url friendly without apache's mod_rewrite?