cPanel redirect doesn't work!

Discussion in 'Apache' started by eWESTPost, Jun 22, 2006.

  1. #1
    Hi,
    I used the feature in cPanel to redirect domain.com to www.domain.com. It palced the following code inside the .htaccess file:

    RedirectMatch permanent ^/$ http://www.domain.com/

    After this the site was unaccessible either with www or without. Only an alert says:

    Redirect limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are blocked.

    Then tried wack0's FAQ:

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^/(.*)$ http://www.domain.com/$1/ [R=301,L]

    Still no redirects but able access both www. and doman.com. :eek:

    Please advice what am I doing wrong here.

    Thanks & Regards.
     
    eWESTPost, Jun 22, 2006 IP
  2. tanfwc

    tanfwc Peon

    Messages:
    579
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Maybe you want to use the inbuild cpanel redirect ?
     
    tanfwc, Jun 24, 2006 IP
  3. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #3
    RewriteEngine on
    Options +Indexes
    Options +FollowSymlinks
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^www.DOMAIN\.com
    RewriteRule (.*) http://www.DOMAIN.com/$1 [R=301,L]
     
    Nintendo, Jun 24, 2006 IP
  4. eWESTPost

    eWESTPost Peon

    Messages:
    158
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Great many thanks w@Ckø! :D

    Would you explain what this line actually do?
    RewriteCond %{HTTP_HOST} !^www.DOMAIN\.com
    Code (markup):
    Read the OP please!
     
    eWESTPost, Jun 26, 2006 IP
  5. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #5
    I'm guessing it says 'If www.DOMAIN.com with out www, do the next line.'
     
    Nintendo, Jun 26, 2006 IP