How to modify my .htaccess file in redirecting to www

5 replies
hey guys,

I can't figure out how I must code my .htaccess file to redirect my coolconfident.com to The Online Self Improvement Magazine For Men | The Cool Confident

First time I got a 500 error and the second time I get a message that I have an unending redirecting loop.

This is the code. Can someone help me out please?

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
#file #htaccess #modify #redirecting #www
  • Profile picture of the author HJdev
    Add this under the line "RewriteBase /":

    RewriteCond %{HTTP_HOST} ^coolconfident\.com$ [NC]
    RewriteRule ^(.*)$ http://www.coolconfident.com/$1 [R=301,L]
    {{ DiscussionBoard.errors[8845215].message }}
    • Profile picture of the author convictie
      Originally Posted by HJdev View Post

      Add this under the line "RewriteBase /":

      RewriteCond %{HTTP_HOST} ^coolconfident.com$ [NC]
      RewriteRule ^(.*)$ http://www.coolconfident.com/$1 [R=301,L]
      Thanks! You're today's hero!
      {{ DiscussionBoard.errors[8845376].message }}
      • Profile picture of the author convictie
        Can someone check if my redirect 301 is working properly? It takes google some time to redirect the indexed pages.

        If I search on google at site:coolconfident.com it takes a bit of loading time when I click an article.

        Will this eventually disappear when everything is indexed properly?
        {{ DiscussionBoard.errors[8845381].message }}
        • Profile picture of the author HJdev
          It works fine here.
          {{ DiscussionBoard.errors[8845520].message }}
          • Profile picture of the author convictie
            Originally Posted by HJdev View Post

            It works fine here.
            Thanks / bedankt!
            {{ DiscussionBoard.errors[8845652].message }}

Trending Topics