hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : force one adress to access a website
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

force one adress to access a website

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 08-14-2006, 03:22 PM
Renard Fin Renard Fin is offline
Junior Guru
 
Join Date: Mar 2006
Posts: 221

force one adress to access a website


Hi guys, sorry for the title which is not that much of a expressive one but it's the most appropriate I had in mind

So here is my "problem" :

How may I detect that someone goes to my website with or without the "www" of the adress.

I'm building a MVC application ... which will use subdomain to ease te application selection.

I want then that if someone access mydomain.com(without "www") will be automatically redirected to www.mydomain.com

Reply With Quote


Sponsored Links
  #2  
Old 08-14-2006, 04:00 PM
stdunbar stdunbar is offline
Web Hosting Master
 
Join Date: Aug 2002
Location: Superior, CO, USA
Posts: 633
On the assumption that you're using Apache, one way would be to create a VirtualHost for "mydomain.com" that is just:

Code:
<VirtualHost *>
    ServerName mydomain.com
    Redirect permanent / http://www.mydomain.com/
</VirtualHost>
I'm sure you could use mod_rewrite magic too though I always mess up the syntax with that

__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums.

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
6Scan Sees Surge of Malicious Attempts During WordPress Attack Web Hosting News 2013-04-18 18:36:19
Incapsula Program Helps Web Hosts Protect Against Brute Force WordPress Attacks Web Hosting News 2013-04-17 12:13:49
Data Center Solutions Firm Force 3 Announces Key Appointments Web Hosting News 2011-11-28 18:02:28
SpamExperts IPv6 Whitelist Foundation Wins IPv6 Task Force Award Web Hosting News 2011-11-18 22:21:53
Data Center Hardware Firm Tech Data Names VP of SMB Sales and GM of Costa Rica Web Hosting News 2011-09-28 17:41:14


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?