subdomain to sub directory

redseer

New member
Joined
Jul 17, 2010
Messages
2
I'm new to directadmin, have had some previous cpanel experience. With cpanel it was very easy for me to install software info a sub directory, and then point a subdomain at it. Can't seem to find this feature on DirectAdmin. Here's the scenario:

mydomain.com/cms/sub1 has the software, initially I want to be able to access it via test.mydomain.com, then once I have all the content up I want to be able to access through sub1.mydomain.com (scenario1) or mydomain.com (scenario2).

This is on a shared server, so there may be some files I can't access.

Thanks for the assistance.
 
Hi,

You should contact the hosting provider and ask them to configure it in virtualhost. I know there are some options which allows you to do it self.
Shared hosting servers are mostly not suitable for this kind of requests.

Just rethinking my own answer, what a better solution is, use a .htaccess which rewrite the directory.
 
Last edited:
after further research, the .htaccess file seems to be the way to go. I have zero experience writing in apache. My ticket on the matter was replied to by my host, they recommend the following code:

Code:
redirect 301 /dir/ /dir/subdir

Does that make sense to those who are proficient with apache?

Thanks
 
That'll create a permanent redirect, which Google and other search engines should feel. Do you intend to have any other code at your main domain? If so, then the redirect won't work as it won't allow you to access anything at the main domain.

I wouldn't want a permanent redirect to a subdomain. I'd want to build the software at my main domain (protecting it with a password if you don't want anyone to see it until it's done). It all depends on what you're doing or why, but my bottom line is if someone types http://www.example.com/ into their browser I'd like them to stay there rather than be redirected to http://www.example.com/subdomain/.

Jeff
 
I'm new to directadmin, have had some previous cpanel experience. With cpanel it was very easy for me to install software info a sub directory, and then point a subdomain at it. Can't seem to find this feature on DirectAdmin. Here's the scenario:

mydomain.com/cms/sub1 has the software, initially I want to be able to access it via test.mydomain.com, then once I have all the content up I want to be able to access through sub1.mydomain.com (scenario1) or mydomain.com (scenario2).

This is on a shared server, so there may be some files I can't access.

Thanks for the assistance.

Me too facing the same problem, PLEASE help me out, i have my own dedicated server. I DON'T KNOW how to do it . please include each step.

thank you in advance.
 
@aryan:

Please don't double-post. I've responded to your other post on this subject. Since the server is yours you'll need to do it yourself. Specific instructions have been previously posted in these forums. Please do not reply further in this thread, but rather in your other thread if necessary.

Thanks.

Jeff
 
subsubdirectory problem with redirect subdomain to subdirectory

I just need this setup for web acess of files. All email is done via MX records to GMail.

In my CNAME setup I have wildcard.mydomain.com redirected to mydomain.com

In my top .htaccess file I have:

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} subdomain1.mydomain.com [NC]
RewriteRule ^(.*)$ http://mydomain.com/subdomain1/$1 [R=301]
RewriteBase /
RewriteCond %{HTTP_HOST} subdomain2.mydomain.com [NC]
RewriteRule ^(.*)$ http://mydomain.com/subdomain1/$1 [R=301,L]

This works well for pages of the kind
http://subdomain1.mydomain.com/page1
http://subdomain2.mydomain.com/page2
(Note that in this setup I have both subdomain1 and subdomain2 pointed to subdirectory with name subdomain1.)

This redirection to subdirectories fails on some systems (e.g., Ubuntu/apache2, but was OK on FreeBSD/apache2?) for
http://subdomain1.mydomain.com/subdirectory/otherpage
I get a FORBIDDEN error:
You don't have permission to access /subdirectory/otherpage on this server.

I assume the rules I have in my .htaccess file just are not strong enough?

Thanks.

Lester
 
I am also getting this error let's say this is my domain http://www.domain.com/stuff

I cannot access the /stuff folder but i have forum installed /forum maby i can access it but not stuff i have something that users can download or a few mp3. Tracks i have made bytheway :) any help on this ? what could i do i have root access on this server
 
Check ownership of files, directory, etc. Without real name information, impossible to be more specific.

Jeff
 
Back
Top