The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

please help me with redirection

Discussion in 'General Discussion' started by Elijah, Apr 28, 2011.

  1. Elijah

    Elijah Registered

    Joined:
    Apr 28, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    please I am on a vps and there is just one domain (mydomain.com) on the server. I have 2 IPs on this server. eg. IP1: 205.334.56.87 and IP2: 205.334.56.88 IP1 is the main server IP and IP2 is empty. Since there is just one domain on IP1, it is supposed to redirect to mydomain.com anytime I type 205.334.56.87 in the address bar but it doesn't redirect. I was having problems with googlebot because googlebot indexed both 205.334.56.87 and mydomain.com versions of the contents of my website and google reported those as duplicate contents. What i did was that, I logged in to cpanel and added these 2 lines to my .htaccess file
    RewriteCond %{HTTP_HOST} ^205\.334\.56\.88
    RewriteRule (.*) http://mydomain.com/$1 [R=301,L]

    which redirected IP1 205.334.56.88 to mydomain.com without any problem. It helped got rid of the duplicate contents in google. However, I updated apache yesterday and today i realized 205.334.56.88 is not redirecting to mydomain.com despite having the above 2 lines in my htaccess file. I don't know what I'm doing wrong. Please help me.
     
    #1 Elijah, Apr 28, 2011
    Last edited: Apr 28, 2011
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,451
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Google itself is viewable by IP only. /http://74.125.95.147/intl/en/about.html

    Try adding one more line above those two lines:

    RewriteEngine on

    Guessing this is all thats missing.


    Code:
    
    
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^cozay.com\.net [OR]
    RewriteCond %{HTTP_HOST} ^205\.334\.56\.88
    RewriteRule (.*) http://www.cozay.com/$1 [R=301,L]
     
  3. Elijah

    Elijah Registered

    Joined:
    Apr 28, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Please thanks very much but it doesn't work. I think there is a problem with some of the WHM settings but I don't know where to fix that. for example yesterday I tried to gzip compress the contents on my site in order to save bandwith and also increase the site load speed using htacess. I tried almost every mod_flate code online but couldn't get it working using .htacess. I had to upgrade apache and then use WHM to globally compress all contents on my site. I couldn't use .htacess to compress but I was able to do that using WHM. Here is an example of what I'm talking about. this IP (69.4.235.45 )address is the main IP address for midphase.com. If you type http://69.4.235.45 in the address bar of your browser and hit enter, it redirects you to http://midphase.com not http://69.4.235.45 which helps prevent duplicate contents.
     
Loading...

Share This Page