rdvapors wrote:Some individuals have experienced a significant increase in the web site performance and some have not. I was one of them then did not get past a B grade. However, I have found many enhancements that helped me just by using the .htaccess file. I have also solved the problem of not being able to access your admin area.
By using this .htaccess file I have 99/100 score with gtmetrix and a page load time of .5 seconds.
You are free to use this of course, but you should rename your original .htaccess before you upload this one.
The final item that needs to be taken care of is deleting the .htaccess file in the smartoptimizer file. This has a conflict with rendering your page correctly with .css files.
Code: Select all
# 1.To use URL Alias you need to be running apache with mod_rewrite enabled. # 2. In your opencart directory rename htaccess.txt to .htaccess. # For any support issues please visit: http://www.opencart.com Options +FollowSymlinks <ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </ifModule> # compress text, html, javascript, css, xml: AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript # Or, compress certain file types by extension: <files *.html> SetOutputFilter DEFLATE </files> <FilesMatch ".(js|css)$"> Header append Cache-Control "private" </FilesMatch> <FilesMatch "\.(gif|jpe?g|png)$"> Header set Cache-Control "public" </FilesMatch> ## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 10 days" ExpiresByType text/css "access plus 1 month" ExpiresByType text/plain "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType application/x-javascript "access plus 1 month" ExpiresByType application/javascript "access plus 1 month" ExpiresByType application/x-icon "access plus 1 year" </IfModule> ## EXPIRES CACHING ## ##SmartOptimizer## <IfModule mod_expires.c> <FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico)$"> ExpiresActive On ExpiresDefault "access plus 10 years" </FilesMatch> </IfModule> <IfModule mod_rewrite.c> RewriteEngine On #RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*\.(js|css))$ smartoptimizer/?$1 <IfModule mod_expires.c> RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^(.*\.(js|css|html?|xml|txt))$ smartoptimizer/?$1 </IfModule> <IfModule !mod_expires.c> RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^(.*\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico))$ smartoptimizer/?$1 </IfModule> </IfModule> <FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico)$"> FileETag none </FilesMatch> ##SmartOptimisre## # SEO URL Settings RewriteEngine On # If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/ RewriteBase / RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L] RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css) RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] ### Additional Settings that may need to be enabled for some servers ### Uncomment the commands by removing the # sign in front of it. ### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that. # 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it: # php_flag register_globals off # 2. If your cart has magic quotes enabled, This may work to disable it: # php_flag magic_quotes_gpc Off # 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try # php_value upload_max_filesize 999M # 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields # php_value post_max_size 999M # 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields # php_value max_execution_time 200 # 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields # php_value max_input_time 200 # 7. disable open_basedir limitations # php_admin_value open_basedir none
When replacing the code in the htaccess. with the above I get an blank page with internal error.
The htacess in the extension documents works though.
My htaccess. todays looks like this:
Code: Select all
# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.
# 2. In your opencart directory rename htaccess.txt to .htaccess.
# For any support issues please visit: http://www.opencart.com
Options +FollowSymlinks
# Prevent Directoy listing
Options -Indexes
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
# Begin Redirect 301
RewriteEngine On
RewriteCond %{HTTP_HOST} !^seriersant\.se [NC]
RewriteRule (.*) http://seriersant.se/$1 [R=301,L]
# BEGIN OpenCart
# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.
# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off
# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off
# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M
# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M
# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200
# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200
# 7. disable open_basedir limitations
# php_admin_value open_basedir none
Please help me out. Reeaaallly need this!
Anyway....you guys give a lot of suggestions and support here to people who has problems or want to make this work.
Cheers,
I use stuff from here as well, the >>Options +SymLinksIfOwnerMatch<< will therefore possibly only work
if the Option is installed as well. Here is the link:
http://www.opencarto.com/other/rabbit-rabbit.html
Make sure to change
Code: Select all
RewriteBase /shop/
It probably still can be 'refined', but, on my server, it works well, so far.
At least, the Pageload-Speed Difference is impressive, compared with others I've tested.
And when it comes to Testsite Pageload Results, I rather care on what I see..., and all Test Sites 'count' differently anyway. Googy is not THE sole Master of 'Standards'....
--------
.htaccess
Code: Select all
# Rabbit Rabbit Security Upgrade
Options +SymLinksIfOwnerMatch
# Prevent Direct Access to files
<FilesMatch "\.(htaccess|tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
Header unset ETag
FileETag None
# Prevent Directory listing
Options -Indexes
# SEO URL Settings
RewriteEngine On
RewriteBase /shop/
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
# compress text, HTML, JavaScript, CSS, and XML
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
<files *.html>
SetOutputFilter DEFLATE
</files>
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
# remove browser bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
<IfModule pagespeed_module>
ModPagespeed on
# using commands,filters etc
</IfModule>
# Leverage Browser Caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType text/css "access plus 1 week"
ExpiresByType application/pdf "access plus 1 week"
ExpiresByType text/x-javascript "access plus 1 week"
ExpiresByType application/x-shockwave-flash "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 week"
ExpiresDefault "access plus 1 week"
</IfModule>
Good Luck
Ernie
http://www.ipc.li/shop/
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Seems a good solution and got support from JAY (with the cache extension). I have the JAY extension so i will try the htaccess solution.
Thanks for your input :-)
Some remarks and questions:
I am using the smartoptimizer extension and want to know if the rabbit htaccess is better.
My Expire caching is now 1 month and in the rabbit htaccess its 1 week. What is better?
In the compress section i have this: (which i don't see in the rabbit htaccess)
# Or, compress certain file types by extension:
<files *.html>
SetOutputFilter DEFLATE
</files>
In Expires caching i have 3 extra lines additional to the rabbit htaccess:
ExpiresByType text/plain "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
I appreciate your opinions regarding these extra entries to improve htaccess.
I tested a new htaccess but when i open the Security update then i got an internal 500 error
# Rabbit Rabbit Security Upgrade
Options +SymLinksIfOwnerMatch
When i comment the line then all is OK again
# Rabbit Rabbit Security Upgrade
# Options +SymLinksIfOwnerMatch
What is causing this and why this works with others. Could this be a conflict with the extension SmartOptimizer?
http://forum.opencart.com/viewtopic.php ... 40#p505241
To your other questions.
... better is, what matches better. There is no such thing as beeing 'Best',
as long as not all Servers on Earth are created equal. It heavy depends on what already
has been 'done' by the Hoster as well, the Hard- and Software used, the Server and Security-Settings,
your Server-Abo, reflecting the Power/Memory/Bandwith-VALUE you get in return, and so on.
Test it, test it, test it. Then you'll find out!
Good Luck
Ernie
ipc.li/shop/
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Is your store in public_html or in public_html/shop ?Anthony1632 wrote:Additional Post to my remarks.
I tested a new htaccess but when i open the Security update then i got an internal 500 error
# Rabbit Rabbit Security Upgrade
Options +SymLinksIfOwnerMatch
When i comment the line then all is OK again
# Rabbit Rabbit Security Upgrade
# Options +SymLinksIfOwnerMatch
What is causing this and why this works with others. Could this be a conflict with the extension SmartOptimizer?
Hosting for Oc 2.x: Well tested on 2.03.1 including emails work correctly, cPanel Shared or WHM VPS, managed security, fast & reliable SSD drives, Raid 10 /4 disk redundancy, server locale - Texas, contact me to discuss further.
we are using latest version for opnecart.
all kinds of stuff into my test-shop. The speed-effect is minimal, by comparing
some of my a little differently 'written' .htaccess files, when reaching a certain
level of performance:
but I have made some tests with my first OC, not indexed/cached as it
is the case with my existing Test-Version. to compare their performance.
Here is the image, it's to large to be displayed here:
http://www.ipc.li/os/grossbild.jpg
just to visualize the difference.
But, speed still depends (a little) on the .htaccess as well, so, one has to try out
everything to match it to the Server as uch as possible.
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
1. *nix Servers are not created equal, 100 (differently owned) Servers do have 99+ different Settings, not even the *NIX Software may be the same...
2. Server IP's can be pointed to 1 (dedicated) or 1'000+ (shared) Site|s, each one operating under it's own URL, and everyone of those Sites has it's place on the Server, sharing a tiny piece of 'some' GHz CPU-Power , of the same 'some' GB of Ram, it's Harddisk and the internal/external Network-Line.
3. Most socalled 'Hosters' are not even Hosters, they just rent a certain File-Space, then reselling Parts of that Space to third Party Customers. Therefore, the have NO Admin Rights, when it comes to Server sided Presettings, such as Memory-Allocations, Cache-Settings, Server .htaccess-settings and more. This makes them inflexible and most usually don't even know, how to certain 'Things' internally would have to be done.
Conclusion: Get a Hoster, beeing MASTER of it's own Server-Universe. Compare, how a hoster is connected to the World, meaning, how much data it's server-farm can really handle and how 'broadly' it's connected to the OUTSIDE-World. Then one know's, what one can expect. So, check, who is the Owner of your Server, them 'move' to him directly, 'shared' or 'dedicated'.
I know, it does not come for free, but nothing GOOD comes for free. Therefore, to get a PRO Shop, it takes a PRO Installation on a PRO Server. Anything else is Dreaming...
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
----
# If using subdirectory, update RewriteBase /
RewriteEngine On
RewriteBase /
----
could be
RewriteBase /cart/
or:
RewriteBase /shop/
or:
RewriteBase /
you did it, you must know, noone else can...
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Yesterday we install Paladin http://www.opencart.com/index.php?route ... n_id=14855
When we access it from backend we get SmartOptimizer Error: File is out of base directory.
We contact Paladin support but they answer us that is not Paladin Fault.
So can you help us?
i unziped files and after css, js and animations of website doenst work...
But, as you wrote, I assume, if you unzipped your files on your PC, you probably uploaded some of the stuff in the Wrong Format to the server. However, it's your first post here, but without any usable information of what you use, what type of Server as well as what type of FTP-Client, what setting you use for individual file type upload (binary/ascii), and at last, what Verions of OC you use. That's a good way to start. The only good way, to be in front, to possibly be assisted..
no offense!
Ernie
bigmax.ch/shop/
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Users browsing this forum: No registered users and 40 guests