Site Redirections & Subdomains

panosru

Verified User
Joined
Oct 8, 2006
Messages
80
Location
Greece
Hello, first of all I like DA very much :)

I used cPanel, Plesk and I conclude to use DA :)

Something that I loved from plesk is that when I setup a subdomain it actually setup out of domains public_html so the files & folders of the main domain don't mess up with subdomain's.

I have a subdomain for examle foo.example.com so under example.com public_html there is a folder called "foo".

I would like to keep files of example.com seperated so I created a subdomain called main.example.com so folder "main" created under public_html.

I moved all files and folders that I needed from public_html under public_html/main/ and I created a redirection from / to http://main.example.com/ but with that way I realized that it produced an unlimited redirection... how can I solve it?
 

mr.applesauce

Verified User
Joined
Jun 3, 2009
Messages
557
All you have to do is add another domain and use the subdomain instead of a regular tld.
 

panosru

Verified User
Joined
Oct 8, 2006
Messages
80
Location
Greece
Yes this would work but I have already set many web application like billing systems, activecollab and etc under that domain so changing the domain its not good solution for me :(
 

mr.applesauce

Verified User
Joined
Jun 3, 2009
Messages
557
You would want to use a html or php redirect then. The way it creates redirects will create endless loops.

In the folder create a file called index.php
Code:
<?php
header( 'Location: http://www.yoursite.com/new_page.html' ) ;
?>
or

In the folder create a file index.html
Code:
<meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com">
 

panosru

Verified User
Joined
Oct 8, 2006
Messages
80
Location
Greece
Hello, yes this is what I done already I placed a header on index.php file I just though I could create a pointer on direct admin for example.com to point on main.example.com but foo.example.com would stay untouched. I guess this is the only benefit I had with Plesk :p
 
Top