1
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 the settings of apache and is not with mod_rewrite
enabled. I would like to find another way to keep Urls friendly and am thinking of architecting an environment where:
http://www.meucliente.com/action/param1/param2/
is replaced by:
http://www.meucliente.com/?/action/param1/param2/
Note the question mark before /action
.
From this the 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 a GET
.
<form action="/?/form-action/" method="POST">...</form>
Here comes the real doubt:
In your opinion this looks very gambiarra?
There is another more elegant way to make the URL friendly without the mod_rewrite
apache?
Can you make htaccess use? Or is it only mod_rewrite that is not enabled? because if you can use htaccess you can create an Handler and have another type of file be interpreted as php...
– Hiago Souza
I’ll catch up and research how it does what you suggested, thanks for the tip.
– Diego Martins