I’m making a web app and I’m checking for the presence of a configuration file to determine whether or not to run the installation script. However, since it is a web app, I have no idea at what URL this script will be stored.
Is there any way to redirect a page, either using PHP or HTML, to a relative file?
Thanks in advance!
You can reconstruct the URL of the currently executing script using the ‘SCRIPT_NAME’ variable set by mod_php. From there it’s just a matter of relative path manipulation to construct the absolute URL of the script you want to redirect to.