Jump to content

Community

htaccess for IPS Forums


Tarun

Recommended Posts

Ok. Since upgrading I have been using this

FileETag None
<IfModule mod_deflate.c> 
<filesMatch ".(css|js|x?html?|php)$">
    SetOutputFilter DEFLATE
  </filesMatch>
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "now plus 1 week"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-javascript "access plus 1 week"
ExpiresByType application/x-shockwave-flash "access plus 1 week"
ExpiresByType video/x-flv "access plus 1 week"
ExpiresByType application/pdf "access plus 1 week"
ExpiresByType text/xml "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType font/woff "access plus 1 month"
ExpiresByType application/font-woff2 "access plus 1 year"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
</IfModule>

Is there any benefit in swapping this for your code? I only ask due to lack of knowledge

Link to comment
Share on other sites

  • 4 weeks later...

These expires (not just yours, in general) create an issue with opcache, I and many of my members appear to be logged out and are not seeing updated topics (we're not, needs a page refresh to show as logged in and show the latest topic list). This only happens when opcache is enabled, so it is clashing somewhere. In which case, how do I have working image expires when I have opcache active?

Edited by marklcfc
Link to comment
Share on other sites

  • 6 months later...
  • 1 month later...

I have just started using this one which i found on another site. Any suggestions with this one considering i have also just started using http2?

<IfModule mod_expires.c>

	ExpiresActive on
	ExpiresDefault                                    "access plus 1 month"
	
	# DATA
	ExpiresByType text/xml                            "access plus 0 seconds"
	ExpiresByType text/html                           "access plus 0 seconds"
	ExpiresByType text/plain                          "access plus 0 seconds"
	ExpiresByType application/xml                     "access plus 0 seconds"
	ExpiresByType application/json                    "access plus 0 seconds"
	ExpiresByType application/rss+xml                 "access plus 1 hour"
	ExpiresByType application/atom+xml                "access plus 1 hour"
	ExpiresByType text/x-component                    "access plus 1 hour"
	
	# MANIFEST
	ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
	ExpiresByType text/cache-manifest                 "access plus 0 seconds"
	
	# SCRIPTS
	ExpiresByType text/css                            "access plus 1 month" 
	ExpiresByType text/javascript                     "access plus 1 month" 
	ExpiresByType application/javascript              "access plus 1 month" 
	ExpiresByType application/x-javascript            "access plus 1 month" 
	
	# IMAGES
	ExpiresByType image/gif                           "access plus 1 month"
	ExpiresByType image/png                           "access plus 1 month"
	ExpiresByType image/jpe                           "access plus 1 month"
	ExpiresByType image/jpg                           "access plus 1 month"
	ExpiresByType image/jpeg                          "access plus 1 month"
	ExpiresByType image/jp2                           "access plus 1 month"
	ExpiresByType image/pipeg                         "access plus 1 month"
	ExpiresByType image/bmp                           "access plus 1 month"
	ExpiresByType image/tiff                          "access plus 1 month"
	ExpiresByType image/svg+xml                       "access plus 1 month"
	ExpiresByType image/vnd.microsoft.icon            "access plus 1 month"
	
	# ICONS
	ExpiresByType image/ico                           "access plus 1 month"
	ExpiresByType image/icon                          "access plus 1 month"
	ExpiresByType text/ico                            "access plus 1 month"
	ExpiresByType image/x-ico                         "access plus 1 month"
	ExpiresByType image/x-icon                        "access plus 1 month"
	ExpiresByType application/ico                     "access plus 1 month"
	
	# AUDIO
	ExpiresByType audio/ogg                           "access plus 1 month"
	ExpiresByType audio/basic                         "access plus 1 month"
	ExpiresByType audio/mid                           "access plus 1 month"
	ExpiresByType audio/midi                          "access plus 1 month"
	ExpiresByType audio/mpeg                          "access plus 1 month"
	ExpiresByType audio/x-aiff                        "access plus 1 month"
	ExpiresByType audio/x-mpegurl                     "access plus 1 month"
	ExpiresByType audio/x-pn-realaudio                "access plus 1 month"
	ExpiresByType audio/x-wav                         "access plus 1 month"
	
	# VIDEO
	ExpiresByType video/ogg                           "access plus 1 month"
	ExpiresByType video/mp4                           "access plus 1 month"
	ExpiresByType video/webm                          "access plus 1 month"
	ExpiresByType video/x-msvideo                     "access plus 1 month"
	ExpiresByType video/mpeg                          "access plus 1 month"
	ExpiresByType video/quicktime                     "access plus 1 month"
	ExpiresByType video/x-la-asf                      "access plus 1 month"
	ExpiresByType video/x-ms-asf                      "access plus 1 month"
	ExpiresByType x-world/x-vrml                      "access plus 1 month"
	
	# FONTS
	ExpiresByType font/truetype                       "access plus 1 month"
	ExpiresByType font/opentype                       "access plus 1 month"
	ExpiresByType application/x-font-ttf              "access plus 1 month"
	ExpiresByType application/x-font-woff             "access plus 1 month"
	ExpiresByType application/font-woff               "access plus 1 month"
	ExpiresByType application/vnd.ms-fontobject       "access plus 1 month"
	
	# FLASH
	ExpiresByType application/x-shockwave-flash       "access plus 1 month"
	ExpiresByType video/x-flv                         "access plus 1 month"
	
	# OTHERS
	ExpiresByType application/pdf                     "access plus 1 month"
	ExpiresByType image/vnd.wap.wbmp                  "access plus 1 month"
	ExpiresByType application/vnd.wap.wbxml           "access plus 1 month"
	ExpiresByType application/smil                    "access plus 1 month"
	
	<IfModule mod_headers.c>
		Header append Cache-Control "public"
	</IfModule>
	
</IfModule>

 

Edited by gavpedz
Link to comment
Share on other sites

  • 8 months later...
  • 3 weeks later...
  • 9 months later...

Just a friendly reminder and clarification. I only offer support here in this thread for the htaccess instead of via PM.

This is because if someone else has the same issues, Instead of having someone who may search for the answer and not be able to find it because it was done via PM.

I want that information to be publicly available and allow for quick resolutions for those who may encounter similar issues.

 

Thanks

Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...

Unfortunately this file where I flagged that it's compatible with the 4.5 release is being rejected. 😞

There have been no changes to the htaccess since June 15, 2016. The only thing that has is simply marking the compatibility with the 4.5 release of the forums.

I'm working to see if I can resolve this issue.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy