Welcome to the IMTalk - Internet Marketing & SEO Forum.
  • Login:
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    WebHostWala is offline IM & SEO Whisperer WebHostWala is on a distinguished road
    Join Date
    Mar 2014
    Location
    India
    Posts
    69
    Thanks Given
    0
    Thanked 3 Times in 3 Posts

    Question Is this correct code ?

    I have included following code to set expiry header in .htaccess of my website. Please check and let me know if it is correct or anything additional to be added to improve website's working.

    <IfModule mod_expires.c>
    ExpiresActive on
    # your document html
    ExpiresByType text/html "access plus 10 minutes"
    # favicon
    ExpiresByType image/x-icon "access plus 1 month"
    # media: images
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    # css and javascript
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType text/javascript "access plus 1 week"

    <IfModule mod_headers.c>
    Header append Cache-Control "private"
    <FilesMatch "\.(js|css|gz)$">
    Header append Vary: Accept-Encoding
    </FilesMatch>
    </IfModule>
    </IfModule>
    Webhostwala -Shared | Reseller | VPS | Cloud

  2. #2
    Digitalpursuit is offline IM & SEO Whisperer Digitalpursuit is on a distinguished road
    Join Date
    Dec 2016
    Posts
    26
    Thanks Given
    5
    Thanked 2 Times in 2 Posts
    I am good at SEO, I cant help you in coding bro...Sorry

  3. #3
    WebHostWala is offline IM & SEO Whisperer WebHostWala is on a distinguished road
    Join Date
    Mar 2014
    Location
    India
    Posts
    69
    Thanks Given
    0
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by Digitalpursuit View Post
    I am good at SEO, I cant help you in coding bro...Sorry
    The code mentioned above is used in .htaccess file and it important w.r.t SEO . So I needed help in that.
    Webhostwala -Shared | Reseller | VPS | Cloud

  4. #4
    nehakwilas is offline IM & SEO Quiet One nehakwilas is on a distinguished road
    Join Date
    Jul 2023
    Posts
    2
    Thanks Given
    0
    Thanked 0 Times in 0 Posts

    Here's the revised version of your code

    Code:
    <IfModule mod_expires.c>
        ExpiresActive on
    
        # Set expiration for HTML files
        ExpiresByType text/html "access plus 10 minutes"
    
        # Set expiration for favicon
        ExpiresByType image/x-icon "access plus 1 month"
    
        # Set expiration for image files
        ExpiresByType image/gif "access plus 1 month"
        ExpiresByType image/png "access plus 1 month"
        ExpiresByType image/jpg "access plus 1 month"
        ExpiresByType image/jpeg "access plus 1 month"
    
        # Set expiration for CSS and JavaScript files
        ExpiresByType text/css "access plus 1 week"
        ExpiresByType text/javascript "access plus 1 week"
    
        # Configure Cache-Control and Vary header
        <IfModule mod_headers.c>
            Header append Cache-Control "private"
            <FilesMatch "\.(js|css|gz)$">
                Header append Vary "Accept-Encoding"
            </FilesMatch>
        </IfModule>
    </IfModule>


 

Similar Threads

  1. Coupon Code
    By don3149 in forum Social Networks & Community Websites
    Replies: 3
    Last Post: 06-02-2014, 03:05 PM
  2. % Code Hostgator need
    By timoinfiji in forum Web Hosting, Servers & Domains
    Replies: 4
    Last Post: 12-20-2013, 10:41 AM
  3. What is the correct way of doing article submission
    By sjeeta in forum Link Building - Articles & Press Releases
    Replies: 14
    Last Post: 02-06-2013, 04:08 PM
  4. Adsense Code
    By rl_lucian in forum Website Planning, Design & Development
    Replies: 9
    Last Post: 09-13-2012, 10:45 PM
  5. Replies: 10
    Last Post: 05-04-2011, 03:57 PM

Tags for this Thread

Posting Permissions

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