subdomain pointer

Hi,

Can i point one of my subdomains to a specific folder?

Thats how it works in SiteWorx as far as I know. I believe whatever the subdomain is is the name of the folder SiteWorx creates.

there is no other way?? i need a different folder to be pointed to my sub domain.

If you are the server admin you can always edit the vhost file for a particular domain in /etc/httpd/conf.d and manually make a subdomain point to whatever directory you want.

<VirtualHost x.x.x.x:80>
SuexecUserGroup user user

DocumentRoot /home/site/site.com/html/subdomainfolder
ServerName subdomain.site.com
.
.
.

I was going to suggest somthing similar to what Justin has in editting the domain.com.conf file, and changing the sub-domain logic, however this could in theory break things are remove some control from the UI.

What I’d suggest, as the cleanest way is;

a) Create your subdomain in the normal way, to create: mysub.domain.com
b) This will, as part of the process create domain.com/mysub
c) Remove the mysub/ folder: rm -Rf mysub/
d) Create a symlink from the name of the subdomain to the folder where your data resides: ln -s mysub myotherdatafolder/

Should in theory, be job done, although this is untested :slight_smile:

It’s also possible to give a subdomain it’s own siteworx account if you don’t want it to also have a folder beneath that domain name. If DNS for that domain is already pointing to that system, the DNS records for the subdomain’s account will be created right automatically.

I might go just the easiest way by doing same name for the sub domain name as my folder name

you can also crate a secondary domain sub.mydomain.com

Also, I’ve never done it but you might be able to try Justin’s code in a .htaccess file.

You might be able to use a rewrite rule in an .htaccess file in your current subdomain folder:


# Redirect subdomain.domain.tls
RewriteCond %{HTTP_HOST} ^subdomain.domain.tld$
RewriteRule ^(.*)$ path/to/new/subdomain/folder/$1

Or something similar :wink:

-tsl-