Help with .htaccess and WordPress blog.

Discussion in 'Apache' started by JudeAustin, Aug 6, 2012.

  1. #1
    Hello.

    I am completely stumped.

    When I visit traxbeat.com the url doesn't rewrite to www.traxbeat.com, so no ads appear on my site because of this issue either.

    But if you simply add /?music or anything to the end it will display ads, I've searched both high and low on Google and numerous forums.

    What is going on?

    This is my current .htaccess file:

    # 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]
    RewriteCond %{HTTP_HOST} ^www\.traxbeat\.com$ [NC]
    RewriteRule ^(.*)$ http://traxbeat.com/$1 [R=301,L]
    </IfModule>
    
    # END WordPress
    
    
    Code (markup):
     
    JudeAustin, Aug 6, 2012 IP
  2. shindig

    shindig Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do you want the non-www to redirect to the www site or the other way round? Because currently it's set to go www -> non-www. Also, you should move those two lines to be just under the RewriteBase line. This is because any line ending in '[L] will cause Apache to stop looking for more Rewrite rules. As it currently is, Apache may not see the redirect rules properly.
     
    shindig, Aug 7, 2012 IP
  3. bLiNNNk

    bLiNNNk Member

    Messages:
    158
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    in wp-admin > settings > general, change WordPress Address (URL) with www.
     
    bLiNNNk, Aug 11, 2012 IP