I'm trying to set up my apache server to redirect domain.com to www.domain.com and I am having troubles. To save me re-posting where I'm at and what I've tried here is a link to my existing post on LQ.


1 Answer 1


All you need to do is to add redirect line to /etc/apache2/sites-available/domainname.vhost file for example:

<VirtualHost *:80>
    ServerName example.com
    Redirect permanent / http://www.example.com/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .