Apache virualhost

Here is my virualhost file:

What should I change to redirect actu.co.il to the same host than www.actu.co.il

Thank

Erez

NameVirtualHost *
<VirtualHost *>
      ServerAdmin webmaster@localhost
      
      DocumentRoot /root/actu.co.il/
      <Directory />
            Options FollowSymLinks
            AllowOverride All
      </Directory>
      <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
      </Directory>
cabouAsked:
Who is Participating?
 
fosiul01Connect With a Mentor Commented:
sorry this should be like this

RewriteEngine on
RewriteCond %{HTTP_HOST} ^http://actu.co.il$
RewriteRule ^(.*)$ www.actu.co.il/ [R=301,L]
0
 
fosiul01Commented:
Are you trying to redirect from http://actu.co.il to www.actu.co.il  ??

in that case either you need to use Rewrite rule

or what ever programming language you are using try to redictect from there.


 
0
 
fosiul01Commented:

i never tryed this way, but it should work, let me know then i will investigate more

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.com$
RewriteRule ^(.*)$ www.actu.co.il/ [R=301,L]

0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
fosiul01Commented:
or check this tutorial

http://corz.org/serv/tricks/htaccess2.php

and this section : lose the "www"
0
 
urgollConnect With a Mentor Commented:
What is the purpose of this ? According to DNS,  actu.co.il and www.actu.co.il are the same host (same IP address). If you want both to simply work, you can add this in your virtualhost block:

    ServerName   www.actu.co.il
    ServerAlias     actu.co.il

0
 
fosiul01Commented:
Hi Sirboutry!!

I dont understand why are you closing this question without giving the points to Experts!!
We gave him the solution but he didnot acknowledge of our commetns.

so as a rule, We should get the points for solution we provided, as far i belived its workable.
0
 
fosiul01Commented:
ID:22648280
ID:22648300
ID:22650799
0
 
urgollCommented:
I second this, option #3 with:

ID:22648280
ID:22648300
ID:22650799
0
All Courses

From novice to tech pro — start learning today.