Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.
Ok so I have a personal site where I have a blog and other database polled information displayed. Out of curiousity and a bit of nudging I would like to be able to have a site for my little lady to be displayed at http://www.mypage.com/hername. I want it to use all the same files I use for my page for easier maintainability. Here's what I've got so far:
main (folder)
--hername (folder)
----index.php (includes the main folder's index.php and sends a user name SESSION variable along with it)
--index.php
--blog.php
--otherstuff.php
Now this works great for the index.php page but not as well for the blog.php page. I would have to make a dummy page for each real page I wanted to include in her folder which seems silly. It wouldn't be so bad if it was as easy as this example looks but the blog page alone has about 4 other pages that go along with it for commenting, adding, and deleting blogs. Add that up with all the other pages I've got for my site and it's quite the chore. Most importantly, to me, though is the fact that I just don't feel like that would be the best solution. Someone's got to have a much more elegant way of doing this. I'm probably overthinking the whole thing. Thanks if advance for the input.
Use an .htaccess file which redirects all references to the folder /hername to a special handling page with user=hername as the parameter. This page will then set appropriate session data (ie: log her in) and redirect to the requested page (blog.php, etc.).
dyonak wrote:VDs from what I've googled are IIS only and htaccess commands will allow me to, in essence, do the same thing with my Apache server, is this correct?
Virtual Direcotries can also be set up using Apache.... they're just not called Virtual Directories You're looking for "alias"
dyonak wrote:VDs from what I've googled are IIS only and htaccess commands will allow me to, in essence, do the same thing with my Apache server, is this correct?
You can set them up in apache too. You need to do it through httpd.conf though, not .htaccess