PDA

View Full Version : website file structure


bluemicrobyte
02-28-2006, 12:50 AM
I'm looking for a way to "mirror" folders on my website -- example:

the folder
www.mysite.com/stuff/pizza
contains 20 files.

the folder
www.addonsite.com/junk/food
should mirror the first folder --


So if a page requires/includes the file
www.addonsite.com/junk/food/file1.php

it would load the file
www.mysite.com/files/pizza/file1.php

Notes: both directories are on the same server - addonsite.com is actually located at /home/user/puplic_html/addonsite/

Why am I doing this? Because I'm trying to set up a phpbb based forum to run on two different URLs with different templates at each URL - meaning 90% of the files will be exactly the same and I modify them often - so by mirroring the second site to the first one I don't have to edit things twice. the other 10% of the files can easily be manually updated on each site seperately.

If I confused you just say so and I'll try to re-explain it. Thanks :P

Neo
02-28-2006, 10:22 PM
You should be able to do a lot of it via .htaccess editing... I think.

That or you could just edit both phpBB's hard files (or templates) and then mirror them manually, and then run them off the same database.

-Neo

bluemicrobyte
02-28-2006, 10:35 PM
I currently have 2 copies of everything and they're both connected to the same database.

Do you happen to know how to do this .htaccess thing?

Neo
02-28-2006, 10:37 PM
Meh. I would google it. Theres someway you can use it to "rewrite" urls (such as have content/node/139 look like 139.htm) or some such.

I can't tell you off the top of my head, because personally, I would just assume run the forums off a general area (ie: forums.mysite.com) and simply have the template be determined by wherever the user was refered from.

-Neo

GrassDragon
02-28-2006, 11:05 PM
Yep, you're looking for the mod_rewrite commands in the .htaccess file. Google will be your best friend here, but I'll warn you, all of this is very difficult and confusing. I set up a second domain on my hosting plan to point to a directory of the first domain, and it took a few more nights than I had wished to do it.

bluemicrobyte
03-01-2006, 4:05 AM
hmmm, that's not encouraging. Before I begin this tiresome task, it will work for php scripts too right? Not just the URL that gets typed into the browser (a forum would be running on these files and there are hundreds of them)

edit:

/me gets back from googling

O_o

Isn't there just a super simple way of telling the server "mirror this folder with this one" instead of all that complicated junk?

Neo
03-01-2006, 4:36 AM
If you have CPanel access you can setup redirections. Either ones that will redirect you completely (ie: sourceforge.net --> sf.net) or ones that simply act like normal address (ie: www.blizzwarworlds.com is actually a folder off kupatrix).

-Neo

Seal
03-01-2006, 2:49 PM
mod_rewrite is fun. but i dont find it useful for redirecting. anyway, it does not affect teh php-side includes, just what user gives to teh server.

bluemicrobyte
03-02-2006, 2:23 AM
Neo: I do have access to cPanel but I'm not sure how to setup redirections to work that way - I only know how to make them redirect you completely (so the browsers URL changes). And will doing it this way allow the forum scripts to access the "non existant" file at the redirected URL?

edit: You aren't refering to addon domains, are you? I know I can have a url www.stuff.com display the contents of public_html/stuff, but what about having www.stuff.com mirror the contents of whatevers in public_html/stuff AND mirror the files from public_html/forums to that folder?