Free Web Hosting Forum
(#1 (permalink))
Old
Member
stannwl is on a distinguished road
 
Posts: 38
Join Date: May 2012
Default Editing .htaccess File - 07-02-2012, 06:35 AM

Hi All,

Currently i'm trying to optimize the loading speed of my website and i'm facing with an issue on "leverage browser caching".

Basically this required me to edit the .htaccess file and i've gotten the following code in the file and uploaded it to the root, but somehow, this code is not right and it's giving me an error code when i try to access my website.

Just for your information, I'm not using wordpress or any other software to build my website. I written the code from scratch

Please help if you know what and how i should do.


<IfModule mod_expires.c>

# Enable expirations
ExpiresActive On

# Default directive
ExpiresDefault "access plus 1 month"

# My favicon
ExpiresByType image/x-icon “access plus 1 year”

# Images
ExpiresByType image/gif "access plus 1 month"

# CSS
ExpiresByType text/css “access 1 day”

# Javascript
ExpiresByType application/javascript "access plus 1 year"

</IfModule>

Simply Into Mortgage
www.simplymortgage.com.sg

Free Cash Rebate when Finance/ Refinance Home Loan Through Simply Mortgage
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
ShocK's Avatar
Senior Member
ShocK is on a distinguished road
 
Posts: 4,099
Join Date: Jul 2011
Location: UK
Default 07-02-2012, 08:04 AM

I thought you should always have this at the start of your code -

RewriteEngine On
RewriteBase /
Reply With Quote
(#3 (permalink))
Old
Member
stannwl is on a distinguished road
 
Posts: 38
Join Date: May 2012
Default 07-04-2012, 02:05 PM

Quote:
Originally Posted by ShocK View Post
I thought you should always have this at the start of your code -

RewriteEngine On
RewriteBase /
I've edit my code and using the following and it's able to run:

<IfModule mod_expires.c>

# Enable expirations
ExpiresActive On

# Default directive
ExpiresDefault "access plus 1 month"

# My favicon
ExpiresByType image/x-icon A2592000

# Images
ExpiresByType image/gif A2592000

# CSS
ExpiresByType text/css A86400

# Javascript
ExpiresByType text/javascript A86400

#
<FilesMatch "\.(gif|jpe?g|png|ico|css|js|swf)$">
Header set Cache-Control "public"
</FilesMatch>

</IfModule>

Just a question to ask, when i test the speed load of my website which 000webhost is hosting my website, i don't have issue with leverage browser caching.

But when i test the speed load of my website which run on another server, the test sometime shows that my leverage browser caching is not optimize, sometime it is.

Is this the server issue or what? Anyone can answer me?

Simply Into Mortgage
www.simplymortgage.com.sg

Free Cash Rebate when Finance/ Refinance Home Loan Through Simply Mortgage
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com