Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
Redirect wildcard subdomains to www.mydomain...
Old 02-01-2009, 11:44 PM Redirect wildcard subdomains to www.mydomain...
Average Talker

Posts: 22
Name: Andrew McGrath
Trades: 0
Hi there,

As the title says *.mydomain.com needs to redirect to www.mydomain.com
Also needs to include any page after. So sexy.mydomain.com/this/is/apage.htm will need to go to www.mydomain.com/this/is/apage.htm

I've been searching google for the last half hour and I can't seem to get anything to work. Some say you just need to modify .htaccess (which I know a little about), some say about editing DNS records (which I'm not sure I have access to).

How to I do this?

Thanks heaps!
__________________

Please login or register to view this content. Registration is FREE
- Search engine optimisation articles.
Please login or register to view this content. Registration is FREE
- Video search.
Please login or register to view this content. Registration is FREE
- Watch, download and keep YouTube videos.
Please login or register to view this content. Registration is FREE
- Advice on relationships, etiquette and everyday life.
andmcg1 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-02-2009, 11:06 PM Re: Redirect wildcard subdomains to www.mydomain...
Average Talker

Posts: 22
Name: Andrew McGrath
Trades: 0
Are we allowed to bump?
__________________

Please login or register to view this content. Registration is FREE
- Search engine optimisation articles.
Please login or register to view this content. Registration is FREE
- Video search.
Please login or register to view this content. Registration is FREE
- Watch, download and keep YouTube videos.
Please login or register to view this content. Registration is FREE
- Advice on relationships, etiquette and everyday life.
andmcg1 is offline
Reply With Quote
View Public Profile
 
Old 02-06-2009, 07:57 AM Re: Redirect wildcard subdomains to www.mydomain...
Average Talker

Posts: 22
Name: Andrew McGrath
Trades: 0
Bump?
__________________

Please login or register to view this content. Registration is FREE
- Search engine optimisation articles.
Please login or register to view this content. Registration is FREE
- Video search.
Please login or register to view this content. Registration is FREE
- Watch, download and keep YouTube videos.
Please login or register to view this content. Registration is FREE
- Advice on relationships, etiquette and everyday life.
andmcg1 is offline
Reply With Quote
View Public Profile
 
Old 02-06-2009, 12:24 PM Re: Redirect wildcard subdomains to www.mydomain...
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,528
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
First off, if you don't have access to the DNS server to create a wildcard DNS setup, redirecting won't matter in the slightest.

Also www. IS a subdomain so if you are not careful you will have a closed loop.

I don't think it would be possible with .htaccess (though it's not my specialty) redirecting ALL subdomains, (including www) to the hostname is practical of course.

Or you could get your hosting techs to add a wildcard ServerAlias and a RedirectMatch to the VirtualHost settings in httpd.conf to create a "catchall virtualhost"
Additions in blue
Code:
<VirtualHost *:80>
    ServerName hostname.tld
    ServerAlias *.hostname.tld
    RedirectMatch 301 (.*) http://www.hostname.tld$1
</VirtualHost>
much cheaper in server CPU resources than mod_rewrite
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-07-2009, 07:00 AM Re: Redirect wildcard subdomains to www.mydomain...
Novice Talker

Posts: 5
Name: Khaldi D.
Trades: 0
Hi this my first post hope it will help.
U can do it with three step.
1- configure your dns to catch *.domain.tld
in windows for testing you can just add A record in lmhosts in /windows/system32/drivers/etc like this
127.0.0.1 *.Domain.*com
in real world contact your hosting to do so.

2- configure apache to redirect the * like mentioned above with serveralias
u need to contact hosting companies 2 for that.

3- add mod_rewrite to .htaccess file
take a look to easymodrewrite.Com then click on catch all subdomains, i just visited this site this morning and i forget to bookmark it if the adress is wrong just type in google "mod rewrite tutorial" and you'll get it in the result.
Hope my post helped you.
khofech is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Redirect wildcard subdomains to www.mydomain...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15146 seconds with 12 queries