non-www takes me to the default index.html

noob here and cant seem to figure out why site.com takes me to the default index.html but www.site.com takes me to my working site.

in my virtual host file, ive already specified the ServerAlias to have both www.site.com and site.com, but site.com still takes me to default..

6 Replies

Do you have both set in your DNS manager?

i have www set and blank set.

blank is non-www right?

Yes blank would be the non-www.

Have you got the default site disabled?

a2dissite default

ah! that did the trick! thanks =)

You might want the default in there, as that can be your "dumping ground" for someone hitting your websites in an odd way (IP, some other name), rather than whatever the first site is.

What's likely your real problem is that the default site listed site.com in the ServerName or ServerAlias fields.

i just looked at the default virtual host file but there is no server name or server alias..

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