Redirect subdomains to a directory

Using a single web hosting account to host multiple sites

Redirect subdomains to a directory

Postby flashi_mx » Sun Jun 21, 2009 8:59 pm

Hi

I want to redirect all my subdomains the a directory with the same name of the subdomain.

for example:

http://111.mydomain.com ----> http://mydomain.com/info/111

http://222.mydomain.com ----> http://mydomain.com/info/222

etc.

I saw the post on virtual subdomains at:

viewtopic.php?p=15046#15046

i have tried but it doesn't work for me, I guess i didn't do it well

I have added a A record DNS like this

*.mydomain.com -----> IP Address

I even tried with a CNAME like this:

*.mydomain -----> mydomain.com

My htaccess access file is the same as appears on that post ( of course I have the domain to my own domain).


Hope some can help with this

Thanks
flashi_mx
 
Posts: 6
Joined: Sun Jun 21, 2009 8:50 pm

Postby richardk » Mon Jun 22, 2009 8:01 am

What happens? What error do you get?
Where is the .htaccess file?
What happens without the mod_rewrite? The same as with the mod_rewrite?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby flashi_mx » Mon Jun 22, 2009 9:34 pm

I have got to admit that i'm not expert in that subject

The htaccess file is the root directory

What do you mean what happen without the mod_rewrite ?
flashi_mx
 
Posts: 6
Joined: Sun Jun 21, 2009 8:50 pm

Postby richardk » Tue Jun 23, 2009 12:23 pm

What do you mean what happen without the mod_rewrite ?

When you delete the mod_rewrite from the .htaccess file.

What happens when you visit the sub domain and there is no mod_rewrite in your .htaccess file?
What happens when you visit the sub domain and there is mod_rewrite in your .htaccess file?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby flashi_mx » Tue Jun 23, 2009 9:02 pm

In all cases i'm getting Address not found

I guess there is somthing wrong with my dns

What record should i add an A or CNAME

Currenly I have an A Record like this

* A IP

Do I need to change it to a CNAME

* CNAME mydomain.com
flashi_mx
 
Posts: 6
Joined: Sun Jun 21, 2009 8:50 pm

A correct to the above post

Postby flashi_mx » Wed Jun 24, 2009 7:24 am

When I have an A record like this

* A IP

I getting a blank page with or without th htaccess file
flashi_mx
 
Posts: 6
Joined: Sun Jun 21, 2009 8:50 pm

Postby richardk » Wed Jun 24, 2009 8:48 am

I getting a blank page with or without th htaccess file

Do you know what directory is being shown (ie. what the sub domain's document root is)?

Are you sure mod_rewrite is being processed in .htaccess files? You can try this mod_rewrite test.

Do you have access to the httpd.conf file? If not you will need to ask your host about where the sub domains go.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby flashi_mx » Wed Jun 24, 2009 12:30 pm

after checking with dreamhost their wilcard records are disables by default

even if you are see it they do not work.

change to hostgator and every thing is working great.

Thank you for time.
flashi_mx
 
Posts: 6
Joined: Sun Jun 21, 2009 8:50 pm


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 1 guest

cron