LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-16-2012, 06:38 AM   #1
adam_1784
Member
 
Registered: Dec 2011
Posts: 41

Rep: Reputation: Disabled
Sub domain Redirect


I want to redirect all my sub domain to their particular directory.
I am able to access this waw: 'www.mydomain.com/subdomain'.
I can access my sub domain directory.
But I want to access 'subdomain.mydomain.com' to access my sub doamain.
I have done the entry in my named.conf file.
* 14400 IN CNAME mydomain

what more changes i need to do in httpd.conf/vhost file?
 
Old 01-16-2012, 07:19 AM   #2
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

many of htaccess rewrites are found on google
"htaccess redirect subdomain to directory"

but you will need a lot of rules if you have many directories/subdomains:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^m\.example\.com$
RewriteRule ^ http://example.com/m%{REQUEST_URI} [L,P]
this will redirect your subdomain "m.example.com" to "example.com/m"

Last edited by lithos; 01-16-2012 at 07:21 AM.
 
Old 01-16-2012, 12:01 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,981

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
Would host header work?
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sub domain Redirect adam_1784 Linux - Software 2 01-11-2012 04:20 AM
how to redirect mail to another address in the same domain jeddie Linux - Newbie 1 09-26-2011 11:15 AM
Parse final domain from redirect link. guest Programming 2 06-06-2011 12:07 AM
DNS redirect unresolved domain ebros Slackware 12 01-29-2011 01:59 AM
domain redirect squid sunlinux Linux - Server 1 03-15-2010 02:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration