How to access site without 'www"

Hi guys, how can i access my site not only by "www.mysite.com", but "mysite.com" too?

Thanks

7 Replies

Create a DNS record with nothing in the hostname field identical to the one you created with "www" in the hostname field, then tell your web server that it is an alias for your existing site.

Do i have to create another DNS zone or edit/add the one i have already?

Edit the zone you already have. Just add another A record.

Also, edit your web server's configuration file and add the bare domain as an alias to your virtual host.

Thanks hybinet, but can you explain how do i edit my web server's configuration file and add the bare domain as an alias to my virtual host?

  • i already have an A Record for my domain without the "www".

Sorry, learnig here.

Thanks

For apache in the virtual host file for your site where it says "ServerName" put a new line under it saying "ServerAlias" with the domain without the www i.e.

ServerName www.domain.com

ServerAlias domain.com

DocumentRoot /home/domain.com/public_html

Then restart apache

You have to add another A record having host name as www.

sorry to be late here..

just go your project folder and access your app setings.py

and Allow_Host use this *

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct