Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 22nd January 2011, 10:15
corpus corpus is offline
Junior Member
 
Join Date: Jan 2011
Posts: 29
Thanks: 8
Thanked 11 Times in 8 Posts
Default [SOLVED] domain to web/subfolder - subdomain to web/subfolder

Hello to this wonderfull community
I'd like to have some help with my dns and subdomains records
first of all sorry for my english

i have a domain example.com
i wanted to redirect it to a subfolder of the main web folder
so the path is web/v4/
so i went to the Redirect tab and i choose Redirect
and added the following options
Redirect type R,L
Redirect Path /v4

i also wanted to keep the /v4/ in the url
so i went to the /etc/apache2/sites-avalaible/ and edit the example.com.vhost produced file
to look like
Code:
    
    RewriteEngine on
    #RewriteCond %{HTTP_HOST}   ^example.com [NC]
    #RewriteRule   ^/(.*)$ /v4/$1  [R,L]
    #RewriteCond %{HTTP_HOST}   ^www.example.com [NC]
    #RewriteRule   ^/(.*)$ /v4/$1  [R,L]
    RewriteCond %{HTTP_HOST} ^example.com.$ [OR]
    RewriteRule ^/?$ "http\:\/\/www\.example\.com\/v4" [R=301,L]
    RewriteCond %{HTTP_HOST} ^www.example.com$
    RewriteRule ^/?$ "http\:\/\/www\.example\.com\/v4" [R=301,L]
this worked for me fine so wen i type example.com in address bar always redirects me to example.com/v4/ and web site works fine

Now
in the root folder i have some other folders
and i want to create subdomainns to lead in this folders
for example subdomain1.example.com to lead in the web/subdomain1 folder
can someone help me to do this ?
sould i make some dns records also and what type?

thank you for your time and plz if you want to help me be as more detailed as you can
thanks again

Last edited by corpus; 25th January 2011 at 16:45. Reason: SOLVED in title
Reply With Quote
Sponsored Links
  #2  
Old 23rd January 2011, 13:23
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Yes, you must create DNS records for the subdomains, either A records that point to your web site's IP address, or CNAME records that point to your main domain (example.com).
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 23rd January 2011, 19:14
corpus corpus is offline
Junior Member
 
Join Date: Jan 2011
Posts: 29
Thanks: 8
Thanked 11 Times in 8 Posts
Default question

falko thank you for your reply

Do i have also create a new web site from Sites - Websites - Add new website ? or create a Subdomain for website from Sites - Subdomain for website - Add new subdomain ?

with a domain subdomain1.example.com
or it will work only with a A name or CNAME ?

if i create a DNS A record should i put in the Hostname field subdomain1.example.com. and in the IP-Address the server ip ?

also for a CNAME record should i put in the Hostname field subdomain1
and in the Target Hostname example.com. ?

the procedure

can someone be more detailed please?
thanks again
Reply With Quote
  #4  
Old 24th January 2011, 14:12
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Quote:
Originally Posted by corpus View Post
falko thank you for your reply

Do i have also create a new web site from Sites - Websites - Add new website ? or create a Subdomain for website from Sites - Subdomain for website - Add new subdomain ?
Yes, you have to somehow create that subdomain, either as a web site of its own or as a subdomain to an existing web site, but that depends on how you want to use the subdomain.

Quote:
Originally Posted by corpus View Post
if i create a DNS A record should i put in the Hostname field subdomain1.example.com. and in the IP-Address the server ip ?

also for a CNAME record should i put in the Hostname field subdomain1
and in the Target Hostname example.com. ?
First you have to find out who controls the nameservers for your domain - if your ISPConfig servers are not authoritative for your domain, then it makes no sense to create DNS records on the ISPConfig server; you must create the records on the authoritative nameservers. You can find them out by running
Code:
dig ns example.com
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 24th January 2011, 16:15
corpus corpus is offline
Junior Member
 
Join Date: Jan 2011
Posts: 29
Thanks: 8
Thanked 11 Times in 8 Posts
Default

Quote:
Originally Posted by falko View Post
Yes, you have to somehow create that subdomain, either as a web site of its own or as a subdomain to an existing web site, but that depends on how you want to use the subdomain.
What is the difference ? i want to have a subdomain to lead to a folder that it has a new web site (some html files ) and i want to keep
subdomain1.expample.com in the url. And also make it work with www. in front of it.

Quote:
Originally Posted by falko View Post
First you have to find out who controls the nameservers for your domain - if your ISPConfig servers are not authoritative for your domain, then it makes no sense to create DNS records on the ISPConfig server; you must create the records on the authoritative nameservers. You can find them out by running
Code:
dig ns example.com
I control the name servers. Ι want to know witch procedure to follow. I have bought the manual but i don't understand completely the procedure to create subdomains.

Thank you for your patience
Reply With Quote
  #6  
Old 24th January 2011, 16:29
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

Quote:
What is the difference ? i want to have a subdomain to lead to a folder that it has a new web site (some html files ) and i want to keep
subdomain1.expample.com in the url. And also make it work with www. in front of it.
If you like to have a subdomain which has its own folder for html files, then you create a nwe website and enter "sub.domain.com" in the domain field. The subdomain function is only used to point a domain to a existing website as additional domain. This option is used if you run a cms system in that website which handles the content for multiple domains.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 24th January 2011, 16:40
corpus corpus is offline
Junior Member
 
Join Date: Jan 2011
Posts: 29
Thanks: 8
Thanked 11 Times in 8 Posts
Default

Quote:
Originally Posted by till View Post
If you like to have a subdomain which has its own folder for html files, then you create a nwe website and enter "sub.domain.com" in the domain field.
Ok i understand this now
And i have also create a DNS record, right?
What kind? a CNAME or A record ?
if it is A name record in hostname field i put
sub.domain.com. and after the ip
if it is CNAME i put in hostname
sub
and in target hostname
domain.com. right ?

the dns record should be created in the same DNS zone of the domain.com zone ?

thanks again

Last edited by corpus; 24th January 2011 at 16:44. Reason: another question
Reply With Quote
  #8  
Old 24th January 2011, 16:45
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

Quote:
And i have also create a DNS record, right?
yes.

Quote:
What kind? a CNAME or A record ?
Both will work. Personally I prefer to use a a-record.

Quote:
if it is A name record in hostname field i put
sub.domain.com. and after the ip
yes. Alternatively you can also use:

host: sub
ip: ip-address

as every record can be defined in short form (sub) or long form (sub.domain.com.). The long form ends always with a dot.

Quote:
sub
and in target hostname
domain.com. right ?
yes.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
corpus (24th January 2011)
  #9  
Old 24th January 2011, 16:52
corpus corpus is offline
Junior Member
 
Join Date: Jan 2011
Posts: 29
Thanks: 8
Thanked 11 Times in 8 Posts
Default

last question i swear

the dns record should be created in the same DNS zone of the domain.com zone ?

thanks
Reply With Quote
  #10  
Old 24th January 2011, 17:02
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
 
Default

Yes. A dns record always belongs to the zone were its created in.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following 2 Users Say Thank You to till For This Useful Post:
corpus (24th January 2011), corpus (24th January 2011)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix queue problem? murunix Server Operation 7 2nd May 2011 01:55
Postfix not forwarding for some domains flappy Installation/Configuration 3 21st November 2010 17:57
freebsd 7, samba 3, domain controller alexdimarco Suggest HOWTO 6 5th November 2010 16:54
How Subdomain works (for documentation) moglia Developers' Forum 7 19th June 2010 22:14
subdomain vs Top domain anares Installation/Configuration 14 12th May 2010 21:00


All times are GMT +2. The time now is 02:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.