I want people to go to www.site.com, but have it pull data from /public_html/mysite and not from /public_html/

mAdMaLuDaWg

Platinum Member
Feb 15, 2003
2,437
1
0
Place this code in your public_html directory as index.html (or whatever default file that directory is set too). Be sure to change the directory/file names to match.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Frames are an awful solution. Please don't blight the interweb with that stuff.

There's a couple of other ways, depending on how much control you have over your server. The elegant thing, I think, would be to point a virtual domain at /public_html/mysite (in httpd.conf, I'm assuming this is apache from the public_html). This works best if you want to serve up the non-mysite contents up to a different domain too.

You could also put a Rewrite rule in /public_html/.htaccess (not sure if that's the precise file name) that changes all requests down by the directory. You might have to play with it for a while to get it to work just right, depending on what you need exactly.

If you only care about that first hit and don't mind the rest of the urls containing /mysite/ then you can do similar to madmaludawg's suggestion by putting a redirect in your index.html so all requests to / get bounced (client-side) to /mysite/.
 

oog

Golden Member
Feb 14, 2002
1,721
0
0
I think .htaccess is the easiest solution if you cannot access httpd.conf (again assuming that you're using apache). It should be easy enough to create a rewrite rule for this purpose.
 

Trevelyan

Diamond Member
Dec 10, 2000
4,077
0
71
If you're trying to have multiple sites hosted on the same account, for example:

www.mysite.com --> public_html/mysite

www.mysite2.com --> public_html/mysite2

www.mysite3.com --> public_html/mysite3

You could just my the domains forward to your /mysite (or /mysite2, /mysite3) directory and mask the URL.