PDA

View Full Version : Directory Structure for base site.



Ducati
02-22-2006, 05:34 PM
Hi there,

When I add an Add-On domain, it asks me what directory I want to create for it. Lets say I have 3 Add-On domains ... Site1, Site2, Site3 ... the directory structure looks something like this ...

public_html
- Site1
- Site2
- Site3

So when a user goes to www.site1.com they get directed to ...
public_html/Site1/index.htm

The problem I have is that I want the main site to also reside in a directory. That way the public_html is perhaps a bit better organized and clear.

Any suggestions on how to make the main site go directly to sub-directory instead of public_html ??

Thanks,

-Duc

2notch
02-22-2006, 07:15 PM
Under public_html, create the subdomain or folder that you want your main site in. Then you'll have:

public_html
- main
- Site1
- Site2
- Site3

Now create a .htaccess file if there isn't one already. Insert the line:

Redirect http://www.yourdomain.com http://www.yourdomain.com/main/

Upload this in ASCII to your public_html folder.

Anyone visiting your site at http://www.yourdomain.com will be redirected to http://www.yourdomain.com/main/

Ducati
02-23-2006, 04:53 PM
Hi there,

Thanks for the pointers, something I was doing was not allowing this to work ... I think. (hehe)

I did some testing on an Add-On domain too.
In the public_html directory I edited the .htaccess file to include ...


Redirect http://www.digitalminion.com http://www.digitalminion.com/forums


Thsi didn't work. So I made the same change to the Add-On directory of ...
public_html/dm

I made the same changes above and nothing. :(

So I took your hint and did some searching on .htaccess on the web. The changes that ended up working were ...


In public/html/dm to .htaccess ...
DirectoryIndex forums/index.php


Since I do not have a index.html page in the main directory, this points the looking for that to the forums. A cheap way I guess of making the forums my homepage.

Again, thanks for pointing me in the right direction.

-Duc

2notch
02-23-2006, 05:26 PM
Glad you found a way to do it. I'll put that in my notes for future use.

jacauc
02-24-2006, 01:06 AM
This sounds very similiar to what I am asking in http://www.bluehostforum.com/showthread.php?t=50

Only other thing...can you see from the browser's point of view that you are being redirected? Does that change the URL in the location bar?

Thanks
Jacauc

2notch
02-24-2006, 08:14 AM
Sounds like you need to use mod_rewrite. Here's a nice cheat sheet:
http://www.ilovejackdaniels.com/apache/mod_rewrite-cheat-sheet/