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.

301 redirect not working

Discussion in 'General Discussion' started by ivancica, Sep 19, 2014.

  1. ivancica

    ivancica Member

    Joined:
    Sep 19, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,
    i have issues with 301 redirect.
    I have domain.com, domain.net and domain.info.
    I've tried permanent redirect in cpanel, but it's not working.
    Every domain has to be redirected to *.com, with or without www.
    I've even tried to entry rewrite code in . htaccess and it's still not working.
    What am I doing wrong?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. ivancica

    ivancica Member

    Joined:
    Sep 19, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I've used cpanel redirect.

    This is what I get in .htacess

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.my-domain.com [NC]
    RewriteRule ^(.*)$ http://my-domain.com/$1 [L,R=301,NC]
    RewriteCond %{HTTP_HOST} ^my\-domain\.info$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.my\-domain\.info$
    RewriteRule ^(.*)$ "http\:\/\/my\-domain\.com\/$1" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^my\-domain\.net$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.my\-domain\.net$
    RewriteRule (.*)$ "http\:\/\/my\-domain\.com\/\$1" [R=301,L]
    What happens? Nothing......
    My-domain.net and my-domain.info are parked domains on my-domain.com

    Entering in the url bar my-domain.info it remains on my-domain.info

    The only thing I see is that the www. is grey not black.
    One redirection is working, www.my-domain.com to my.domain.com

    Why aren't the other redirections than working?
     
  4. server9host

    server9host Well-Known Member

    Joined:
    Sep 18, 2013
    Messages:
    160
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello,

    If you are added My-domain.net and my-domain.info as parked domain of my-domain.com, So it's not redirect to domain my-domain.com.

    When you browse my-domain.info then it's show content of my-domain.com but it show URL as my-domain.info.

    Park domain use for this purpose, park domain use same web page and db of primary domain. If you want redirect URL from my-domain.info to my-domain.com then you need to remove park domain and use above redirection code in .htaccess file.

    Please check and let me know.


    Thanks
     
  5. ivancica

    ivancica Member

    Joined:
    Sep 19, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you for helping me. I understand now everything.
     
  6. server9host

    server9host Well-Known Member

    Joined:
    Sep 18, 2013
    Messages:
    160
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello,

    Thanks for update. :)
     
  7. ivancica

    ivancica Member

    Joined:
    Sep 19, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,
    I have again a problem with .htaccess.
    The rewrite cond is not working for files, or I'm doing it wrong.
    I have to redirect every link that Google indexed for a client.
    For example my-domain.com/shop/..... everything next
    to my-domain.com/store/ home page

    Direct redirection thru cpanel doesn't do the job.
    What to do?
     
  8. ivancica

    ivancica Member

    Joined:
    Sep 19, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I already have redirections on that site. my-domain.net and .info are redirected with/or without www to my-domain.com.... The redirections work on parked domain ONLY if they are added in .htaccess on the top not on the bottom.

    For redirection on shop to store, I've tried every rewrite cond and redirect cond I could found on the web.... nothing is working..
    It needs to be done....
    Please help
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You may need to consult with a web developer or a qualified system administrator if you require assistance developing custom Mod_Rewrite rules for your website. Or, you may want to post on forums such as WHT to see if you can find additional user-feedback on this subject. The forums here are primarily intended for issues related to the cPanel/WHM software itself so you may not receive the feedback you are seeking for custom Mod_Rewrite rules.

    Thank you.
     
Loading...

Share This Page