Geuis Posted September 23, 2004 Posted September 23, 2004 I think this problem has a simple solution but I'm at a loss to find it. On my site I want to launch now that its ready, I have a subdomain that points to a directory on the site that has its own application. Its essentiallya sub-site that will be effectively separate from my main site I'll be launching later. Problem is this. If I type in the subdomain, it takes me right in. However, it changes the url to be the full path name of the domain www.thetechgurus.net/.... How can I make it so that the site URL will only show as the format http://subdomain.thetechgurus.net/folder/folder2/. I don't want it to appear as http://www.thetechgurus.net/folder/folder2/. Second problem, which is actually more important. If I type http://www.thetechgurus.net/folder/folder2, the site will load properly. However, if I do http://www.thetechgurus.net/folder/, I see the directories instead of a webpage. This is a security risk and I do not want any users to be able to see this directory since its not supposed to be a valid url path. What I've tried so far was to setup a permanent redirect so that if the url http://www.thetechgurus.net/folder/ were entered, it would redirect that url to the url of the actual path, http://www.thetechgurus.net/folder/folder2/. However, if I do that I get warnings that I have reached the maximum number of redirects and a cookie warning, and I am not able to access the subsite. I have to remove that redirect in order to be able to access the subsite. What is the best way to make that middle directory inaccessible and automatically just go to the full path? Quote
TCH-Rob Posted September 23, 2004 Posted September 23, 2004 For the second problem, put this in your .htaccess file; Options -Indexes Quote
Geuis Posted September 23, 2004 Author Posted September 23, 2004 Ok, that worked great. Anyone have any ideas on the first idea? I'd like to have my subdomain appear as the primary url, not the original domain. Thanks. Quote
TCH-Don Posted September 23, 2004 Posted September 23, 2004 How did you create the sub domain? because non of mine work that way. They stay as sub.domain.ext/page or sub.domain.ext/folder/folder/page Quote
Geuis Posted September 23, 2004 Author Posted September 23, 2004 I did it through the subdomain control panel in cpanel. I created the subdomain nycpics.thetechgurus.net. I set the redirection to go to first http://www.thetechgurus.net/nycpics/gallery. I just changed it to redirect to http://nycpics.thetechgurus.net/nycpics/gallery but it does the same thing. If I type http://nycpics.thetechgurus.net it redirects to http://www.thetechgurus.net/nycpics/gallery. Not sure there's any other way I could be doing this. Quote
TCH-Andy Posted September 23, 2004 Posted September 23, 2004 Hi, I just had a quick look, and you had in incorrect redirect. YOu were redirecting to h**p://nycpics.thetechgurus.net/nypics/gallery but it should be redirected to h**p://nycpics.thetechgurus.net/gallery My only other question would be why you have the nypics directory if you want to redirect everything into gallery? why not put the gallery files directly in the nypics folder. Quote
TCH-Don Posted September 23, 2004 Posted September 23, 2004 When you create a sub domain in cpanel, cpanel does all the work. you do not have to set any redirections, in fact that can cause problems. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.