htaccess file for vb 5.2.3

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LifeChargr
    Member
    • Feb 2012
    • 36

    htaccess file for vb 5.2.3

    Anyone know the default code for the htaccess file. When I upgraded, the htaccess file was not in there. I moved one from an old version that i upgraded from 4.2.3, because it was also missing from the 5.2.2 upgrade.. The code reads as follows. I believe the htaccess file is supposed to help with performance, so it is important because my site is slow right now, and I think it relates to my htaccess file.

    <IfModule mod_rewrite.c>
    RewriteEngine On

    # In some cases where you have other mod_rewrite rules, you may need to remove the
    # comment on the following RewriteBase line and change it to match your folder name.
    # This resets the other mod_rewrite rules for just this directory
    # If your site was www.example.com/forum, the setting would be /forum/
    #RewriteBase /

    # Send css calls directly to the correct file VBV-7807
    RewriteRule ^css.php$ core/css.php [NC,L]

    # Redirect old install path to core.
    RewriteRule ^install/ core/install/ [NC,L]

    # Main Redirect
    RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png|css)$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]

    # Because admincp is an actual directory.
    RewriteRule ^(admincp/)$ index.php?routestring=$1 [L,QSA]

    </IfModule>

    <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE application/atom+xml \
    text/javascript \
    application/x-javascript \
    application/javascript \
    application/json \
    application/rss+xml \
    application/vnd.ms-fontobject \
    application/x-font-ttf \
    application/xhtml+xml \
    application/xml \
    font/opentype \
    image/svg+xml \
    image/x-icon \
    text/css \
    text/html \
    text/plain \
    text/x-component \
    text/xml
    </IfModule>

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType application/x-javascript A1209600
    ExpiresByType text/javascript A1209600
    ExpiresByType application/javascript A1209600
    ExpiresByType text/css A31536000
    ExpiresByType image/x-icon A2592000
    ExpiresByType image/icon A2592000
    ExpiresByType application/x-ico A2592000
    ExpiresByType application/ico A2592000
    ExpiresByType image/gif A2592000
    ExpiresByType image/jpeg A1209600
    ExpiresByType image/jpg A1209600
    ExpiresByType image/png A1209600
    ExpiresByType application/x-shockwave-flash A1209600
    ExpiresByType font/ttf A2592000
    ExpiresByType font/otf A2592000
    ExpiresByType font/x-woff A2592000
    ExpiresByType image/svg+xml A2592000
    ExpiresByType font/truetype A2592000
    ExpiresByType font/opentype A2592000
    ExpiresByType application/x-font-woff A2592000
    ExpiresByType application/vnd.ms-fontobject A2592000
    </IfModule>

    <IfModule mod_headers.c>
    Header set Connection keep-alive
    <filesmatch "\.(ico|flv|gif|swf|eot|woff|otf|ttf|svg)$">
    Header set Cache-Control "max-age=2592000, public"
    </filesmatch>
    <filesmatch "\.(jpg|jpeg|png)$">
    Header set Cache-Control "max-age=1209600, public"
    </filesmatch>
    <filesmatch "\.(eot|woff|otf|ttf|svg)$">
    Header set Cache-Control "max-age=2592000, public"
    </filesmatch>
    # css and js should use private for proxy caching https://developers.google.com/speed/...geProxyCaching
    <filesmatch "\.(css)$">
    Header set Cache-Control "max-age=31536000, private"
    </filesmatch>
    <filesmatch "\.(js)$">
    Header set Cache-Control "max-age=1209600, private"
    </filesmatch>
    </IfModule>



    I believe I have to add the following because my non www. addresses need to be redirected back to my www. addresses, this was a problem back in 5.2.2 also, that is when I got the code below..
    RewriteEngine on RewriteCond %{HTTP_HOST} ^agentlinkus.com[nc] RewriteRule ^(.*)$ http://www.agentlinkus.com/$1 [r=301,nc]

    Is there anything I need to add to my htaccess file for vb 5.2.3? Also, the code I was told to add, does not seem to be the same format as the default code that was in my last upgrade to 5.2.2.

    Please let me know if I have revealed anything on this post that can put my site as risk.

    I appreciate your feedback. =)
  • Mark.B
    vBulletin Support
    • Feb 2004
    • 24286
    • 6.0.X

    #2
    The htaccess file is in the download package, but it is called htaccess.txt. You would rename this to .htaccess. It may not be visible on the server though - some servers do not show htaccess files once they are there.
    Last edited by Mark.B; Thu 15 Sep '16, 1:01pm.
    MARK.B
    vBulletin Support
    ------------
    My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
    My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

    Comment

    • Wayne Luke
      vBulletin Technical Support Lead
      • Aug 2000
      • 73981

      #3
      Your site's front page loads in less than three seconds for me. What is the cause for concern specifically?

      Loads faster with your Google Ads blocked.
      Translations provided by Google.

      Wayne Luke
      The Rabid Badger - a vBulletin Cloud demonstration site.
      vBulletin 5 API

      Comment

      Related Topics

      Collapse

      Working...