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.

webpage redirection is not working

Discussion in 'General Discussion' started by rootuser, Mar 31, 2005.

  1. rootuser

    rootuser Well-Known Member

    Joined:
    Jan 31, 2005
    Messages:
    124
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    ***INDIA***
    Webpage redirection is not working, For example from http://example.com to http://www.example.com is not working either with the built-in 301 redirect, or
    typing it in by hand, or using mod_rewrite.Any solutions please . :) :)
     
  2. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Is mod_rewrite installed?

    Have you checked to see whether the 302 redirect is actually coming back? (use one of the public checkers to see what headers come back).

    You may have to redirect example.com/ rather than example.com.

    Redirection works fine here ...
     
  3. rootuser

    rootuser Well-Known Member

    Joined:
    Jan 31, 2005
    Messages:
    124
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    ***INDIA***
    YA mod_rewrite installed, but redirection is not working here
     
  4. adept2003

    adept2003 Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    283
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    ~ "/(extra|special)/data"
    Try the following:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^www\.newdomain\.com [NC]
    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

    this will permanently redirect everything except www.newdomain.com to www.newdomain.com
     
    #4 adept2003, Apr 26, 2005
    Last edited: Apr 26, 2005
Loading...

Share This Page