Forum Moderators: coopster
It seems as though you may be looking for Apache's mod_rewrite [httpd.apache.org] module. Or are you looking for something in PHP? The Apache module fits exactly what you are asking for, though...
DefaultType application/x-httpd-php This means any files without an extension are served as php.
I use this for several sites.
So just rename your contact.php to contact, and the parameters after it will be in PATH_INFO. (e.g. /contact/my/pages/ will have "/my/pages/" in PATH_INFO which you can then use to decide what to display). The last slash may not always be present depending on how the url was typed.
Rob
[edited by: jatar_k at 4:37 am (utc) on Oct. 26, 2004]
[edit reason] generalized urls [/edit]
the templates wont include my files that need to be included
Works fine for me with our without the slash, maybe it's something to do with the way you handle the path_info within the script (or does the path of the include depend on one of the parameters?).
I do this sort of thing to get a consistent result (on a script that only has a single parameter):
$path_info = $_SERVER["PATH_INFO"];
if (!$path_info) {$path_info = $_SERVER["SCRIPT_URL"];};
$path_info = trim($path_info,'/');
$parm = strip_tags(trim($path_info));
Can't remember why I do the Script_url bit but it's there for some reason and doesn't seem to do any harm. :-)