Using directories instead of .php?var=value
Posted: Tue Feb 05, 2008 12:11 pm
Hi all,
This is probably a silly question, but I can't get my head around it.
How is this done? See example here: http://www.netbar.se (Sorry, in Swedish, but language is not important, you don’t have to read it).
Each category in products are linked to a directory, such as http://www.netbar.se/produkter/calvados/alla/ and there the page is presented.
But I doubt they have duplicated the site content in every category. Rather I thought it was done with an index.php in the directory “calvados”, that had an include(); to a file in the root. And that was repeated for each category. Of course that approach works, but when the file is included all relative links (/js/script.js, css/page.css, <img src=images/image.gif /> etc) in the file that is being included will not work. I took a look at topics regarding include(), but didn't get any wiser.
I have looked at the code and they do use relative links, how do they achieve it (without having absolute paths)?
Thanks for any insight and help.
This is probably a silly question, but I can't get my head around it.
How is this done? See example here: http://www.netbar.se (Sorry, in Swedish, but language is not important, you don’t have to read it).
Each category in products are linked to a directory, such as http://www.netbar.se/produkter/calvados/alla/ and there the page is presented.
But I doubt they have duplicated the site content in every category. Rather I thought it was done with an index.php in the directory “calvados”, that had an include(); to a file in the root. And that was repeated for each category. Of course that approach works, but when the file is included all relative links (/js/script.js, css/page.css, <img src=images/image.gif /> etc) in the file that is being included will not work. I took a look at topics regarding include(), but didn't get any wiser.
I have looked at the code and they do use relative links, how do they achieve it (without having absolute paths)?
Thanks for any insight and help.