Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Nov 2014
    Posts
    10
    Force www on Wordpress site with W3 Total Cache
    Hello,

    I'm after a bit of assistance with forcing the www on a Wordpress site with W3 Total Cache installed.

    The reason for this is due to using the CNAME method through CloudFlare.

    I've tried changing the URL with the www in the Wordpress general settings which works for links you click on the site but if you visit the site without the www then it does not force it and instead loads the page with a couple if icons missing.

    I know there is a .htaccess method however due to W3 Total Cache putting a whole lot of content in there, I'm not sure how to go about this.

    Any assistance would be appreciated.

    Current .htaccess file
    Code:
    # Inserted By Customer Control Panel
    
    
    # BEGIN W3TC Browser Cache
    <IfModule mod_deflate.c>
        <IfModule mod_headers.c>
            Header append Vary User-Agent env=!dont-vary
        </IfModule>
            AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
        <IfModule mod_mime.c>
            # DEFLATE by extension
            AddOutputFilter DEFLATE js css htm html xml
        </IfModule>
    </IfModule>
    # END W3TC Browser Cache
    # BEGIN W3TC Page Cache core
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
        RewriteCond %{HTTP:Accept-Encoding} gzip
        RewriteRule .* - [E=W3TC_ENC:_gzip]
        RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
        RewriteRule .* - [E=W3TC_PREVIEW:_preview]
        RewriteCond %{REQUEST_METHOD} !=POST
        RewriteCond %{QUERY_STRING} =""
        RewriteCond %{REQUEST_URI} \/$
        RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
        RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
        RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]
    </IfModule>
    # END W3TC Page Cache core
    # 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

  2. #2
    Registered User
    Join Date
    Mar 2015
    Posts
    1
    Wink
    Try adding this on your .htaccess file

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ hxxp://bbb.%{HTTP_HOST}/$1 [R=301,L]
    just replace the "xx" with "tt" and "bbb" with "www"

  3. #3
    Registered User
    Join Date
    Nov 2014
    Posts
    10
    Quote Originally Posted by trevordev View Post
    Try adding this on your .htaccess file

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ hxxp://bbb.%{HTTP_HOST}/$1 [R=301,L]
    just replace the "xx" with "tt" and "bbb" with "www"
    Thank you for your assistance with your first post

    Anywhere in particular in that .htaccess?

Similar Threads

  1. BlueBurst | WordPress Maintenance & Support | 75% off first month
    By Blockey in forum Australian Related Offers and Requests
    Replies: 0
    Last Post: 23-04-2014, 11:26 PM
  2. Australian Managed WordPress Hosting - $11 for 1 site, $99 for 10 sites
    By Blockey in forum Australian Shared Web Hosting Offers
    Replies: 0
    Last Post: 30-10-2013, 10:11 PM
  3. Australian Managed WordPress Hosting - $24 for 1 site, $99 for 10 sites
    By Blockey in forum Australian Shared Web Hosting Offers
    Replies: 0
    Last Post: 15-10-2013, 06:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •