XF 1.5 .htaccess not redirecting all pages to non www version... I think?

PumpinIron

Well-known member
I'm helping fellow XenForo newbie @Mrcdboston get his forum up and running. In the process of this, we've encountered an issue.

The site in question is https://thefriendlygearpage.com

If you visit that, you'll see it works fine.

Now go to https://www.thefriendlygearpage.com

It doesn't work, and if you look at the URL bar, it drops the .com from the end.

Not go to https://www.thefriendlygearpage.com/forums/forum-issues-reporting.230/

That page works just fine and redirects you to the non www version of the page, as it should.

Near as I can tell, every page in the site works just fine except for the home page. If you go to the www version of the site, it should redirect you to the non www version, plain and simple.

Here's the .htaccess file just incase it helps:

Apache config:
#    Mod_security can interfere with uploading of content such as attachments. If you
#    cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#    SecFilterEngine Off
#    SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 406 default
ErrorDocument 500 default
ErrorDocument 501 default
ErrorDocument 503 default

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www\.thefriendlygearpage\.com [NC]
    RewriteRule ^(.*)$ https://thefriendlygearpage.com/$1 [L,R=301]

    RewriteEngine On
 
    #    If you are having problems with the rewrite rules, remove the "#" from the
    #    line that begins "RewriteBase" below. You will also have to change the path
    #    of the rewrite to reflect the path to your XenForo installation.
    # RewriteBase /xenforo
 
    #    This line may be needed to enable WebDAV editing with PHP as a CGI.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
 
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>

For what it's worth, I'm using that exact same .htaccess file on my personal forum and it works just fine without this issue.

So I'm only assuming this issue is .htaccess related as I'm not sure what else it could be.
 
Back
Top Bottom