Redirect without WWW to a WWW domain for Vhost.

Adding redirect to preferred domain with WWW instead of without www.

Use the following .

<VirtualHost *:80>
  ServerName www.namran.net
  ServerAlias namran.net
  RewriteEngine on
  RewriteCond %{HTTP_HOST}                ^namran.net(:80)?$
  RewriteRule ^/(.*)                      http://www.namran.net/$1 [L,R=301]
 
  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>
  ProxyPass / http://www.namran.net/
  ProxyPassReverse / http://www.namran.net/
 
</VirtualHost>

Then restart the httpd.

And re-test.

Get Free Email Updates!

Signup now and receive an email once I publish new content.

I will never give away, trade or sell your email address. You can unsubscribe at any time.

Like

Related Post

2 Responses

  1. desa ku pilar says:

    Hello there, I believe your web site may be having browser compatibility issues.
    When I take a look at your blog in Safari, it looks
    fine but when opening in Internet Explorer, it has some overlapping issues.
    I merely wanted to provide you with a quick heads up! Aside from that,
    great blog!

    Reply
  2. pub quiz austin texas says:

    DJ spins out on Saturday nights. At the end of each round
    read out the cumulative scores. Theme Format: It is almost like standard format of the pub quiz.

    Reply

Anything to add?

X