Welcome to WebmasterWorld Guest from 54.221.75.68

Forum Moderators: Ocean10000 & phranque

WWW redirect on htaccess or Registrar?

     
7:45 pm on Apr 3, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Dec 19, 2004
posts:887
votes: 11


Hi so I wanted to know that my redirect for all "example.com" requests to goto "www.example.com" should be in my apache server account's .htaccess file or in my domain registrar? Thanks!
11:15 pm on Apr 3, 2018 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15256
votes: 691


With/without www has nothing to do with the registrar or even the DNS*. Did you mean the host, who maintains the config file? It's true that “www.” is technically a subdomain, but it doesn't behave the same as other subdomains.

Keep all your redirects in one place. In this case, that means the site's htaccess file.


* With possible rare, bizarre exceptions that we need not think about.
3:41 am on Apr 4, 2018 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:11453
votes: 173


just to clarify how this works, the registrar is about domain ownership/contact information and refers to the domain name servers.

the dns points hostnames to server IP addresses.
the dns can be configured so example.com goes to one one IP and www.example.com goes to a different IP and blog.example.com goes to another, etc.
it is also possible to allow a wildcard subdomain specification for an address record.

where requests for example.com vs www.example.com are served depends on how the dns is configured.
if the dns is configured so any or all hostnames (subdomains) of example.com point to the same web server, the web server can be configured so each hostname has its own virtual host configuration or a virtual host configuration can also specify a wildcard subdomain.

other than the conventional usage of www.example.com as the default or preferred hostname for serving web content, its behavior is exactly as any other arbitrary subdomain similarly configured.

Hi so I wanted to know that my redirect for all "example.com" requests to goto "www.example.com" should be in my apache server account's .htaccess file or in my domain registrar?

the directives for redirecting example.com requests to www.example.com should reside on the server (more specifically the example.com virtual host) in either the document root directory's .htaccess file or in the server config file within the appropriate VirtualHost or Directory context.
12:01 am on Apr 6, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Dec 19, 2004
posts:887
votes: 11


Ok I have it on htaccess for now but I noticed G domains has option to forward example.com to www.example.com
12:41 am on Apr 6, 2018 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15256
votes: 691


Your host probably has the option too (mine says with-www only, without only, or both). But, since it is done somewhere other than your own htaccess, it can lead to chained redirects. Always better to keep things under your own control.
2:28 am on Apr 6, 2018 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:11453
votes: 173


^^that^^
9:31 pm on Apr 6, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Dec 19, 2004
posts:887
votes: 11


Ok thanks all! :-) htaccess
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members