If you can change create-order.php
, then you can make it so that it does not rely on relative paths. One way to do this is to create a bootstrap.php
file that has all of the includes and then your "leaf" PHP files only have to find this bootstrap.php
file.
Another option is to set the PHP path. If you change the include path to include the root of the directory, then when including files in create-order.php
will look in the root and it will find them. You can set the include path in your PHP files or in the PHP configuration.
If you don't want or can't change create-order.php
then one way to do this would be via the webserver. For example, in apache, you can use mod_rewrite to do just that, have a public URL actually invoke a specific local file. The rewrite configuration might look like this (example for just this one file):
RewriteEngine on
Options +FollowSymlinks
RewriteRule ^orders/create to create-order.php$ create-order.php [L]
or a catch-all rule with this (untested):
RewriteRule ^orders/(.*)$ $1?%{QUERY_STRING} [L]