theniteowl
Programmer
I am using an HTACCESS file to intercept and redirect requests through a PHP page.
My Index.php acts as a template showing the page structure and navigation controls and then loads the requested page into the content area of the template.
The issue is that the template loads from the root folder.
After the redirection occurs the root folder is the active folder. The index.php file uses the path to the requested page in order to do an include for that page.
The problem is that when people create their content pages they use relative paths from where that page resides on the server. So if they have a link to another page or image in the same folder simply using href="otherfile.htm" will not work since the active folder is actually the root folder.
Is there a command available that will change the active folder to the one I load the requested page from?
I would like to redirect to my template and let it load the page structure then alter the active folder to the one it is about to do the include from so once the page is rendered the paths work normally without them having to always remember to use full paths for every link.
Thoughts?
I have asked in the PHP forum but have not yet heard from anyone. I wondered if there was something specifically related to Apache that I could use.
Thanks.
At my age I still learn something new every day, but I forget two others.
My Index.php acts as a template showing the page structure and navigation controls and then loads the requested page into the content area of the template.
The issue is that the template loads from the root folder.
After the redirection occurs the root folder is the active folder. The index.php file uses the path to the requested page in order to do an include for that page.
The problem is that when people create their content pages they use relative paths from where that page resides on the server. So if they have a link to another page or image in the same folder simply using href="otherfile.htm" will not work since the active folder is actually the root folder.
Is there a command available that will change the active folder to the one I load the requested page from?
I would like to redirect to my template and let it load the page structure then alter the active folder to the one it is about to do the include from so once the page is rendered the paths work normally without them having to always remember to use full paths for every link.
Thoughts?
I have asked in the PHP forum but have not yet heard from anyone. I wondered if there was something specifically related to Apache that I could use.
Thanks.
At my age I still learn something new every day, but I forget two others.