I have the faint remembrance that it was possible in PHP to replace the usual ? URL paramenters by one that used / instead.
Like for example replace:
<website>/view.php?id=345
by
<website>/view.php/345 or <website>/view.php/id/345
Is this possible and how?
If not, can this be accomplished with apache's mod_rewrite?
URL Parameters using / instead of ?
Started by linuxprogramming4ever, Nov 27 2009 01:29 PM
6 replies to this topic
#1
Posted 27 November 2009 - 01:29 PM
|
|
|
#2
Posted 27 November 2009 - 01:40 PM
PHP alone cannot rewrite URL's but if you use apache's mod_rewrite PHP can get the url parameters back.
#3
Posted 28 November 2009 - 03:47 AM
Thanks, got it to work with mod_rewrite.
#4
Posted 29 November 2009 - 01:53 PM
BlaineSch said:
PHP alone cannot rewrite URL's but if you use apache's mod_rewrite PHP can get the url parameters back.
Don't be so naive young grasshopper. SEF URLs with out mod_rewrite | John Ciacia
#5
Posted 29 November 2009 - 02:04 PM
John said:
Don't be so naive young grasshopper. SEF URLs with out mod_rewrite | John Ciacia
How would you setup the server to accept the url though? Yes you can parse through a address easily but if you don't have a mod_rewrite or something else, won't you get a 404 error for anything that is already not a file? How do you set that up on the server end?
#6
Posted 29 November 2009 - 02:11 PM
You set the server up to do nothing - the php file exists, so the server will load that, there is no 404 error.
#7
Guest_Jaan_*
Posted 29 November 2009 - 05:00 PM
Guest_Jaan_*
Young grasshopper hahahahahaha.. lol pwned
but umm.. I learned something today ^^ thanks John..
but umm.. I learned something today ^^ thanks John..


Sign In
Create Account


Back to top










