I've our fundamental corporate static html website set up in our web root directory and our billing software set up in /portal. I've integrated those sites to resemble a single site by such as the /menu.tpl smarty template file within the /portal/header.tpl file. However, basically use relative URL's, recption menus sysem does not act as the bottom url for that billing script is /portal. i.e. basically produce a connect to faq.php within the menu.tpl and that i load a webpage around the portal site, the hyperlink within the menu to the faq page has become /portal/faq.php whereby basically load a webpage from the root site the hyperlink is simply /faq.php as it ought to be.
The apparent response is to simply use absolute URL's, however i require the site to become portable when i have numerous designers who require to set up and test drive it.
I cant find anyway to solve this. Any ideas?
I went in to the same issue while you not long ago, and after trying lots of dead finishes, I finally wound up using the following solution:
- For just about any URL you have to be a chamelion, i.e. change its path with respect to the atmosphere, place a PHP function that creates the correct URL.
- Should you range from the PHP function from one central file, you'll be able to change all the URL's within the entire site instantly, with different setting, or some pre-detected switch like the current domain title, etc.
<?php print_base_url_plus("/menu.php"); ?>
... where print_base_url_plus() is really a function which appends the bottom URL to the output.
You might find you need to change a few of the URL's to become php, so that they are preprocessed through the PHP engine, or, you are able to affect the web configurations to ensure that standard .htm files are piped with the PHP engine, much like .php files.