Post by sunster » Mon Sep 02, 2013 8:09 am

TL:DR (like all your non clear and concise postings)

Wow you just don't stop do you. Keep beating your dead horse.

New member

Posts

Joined
Thu Sep 27, 2012 3:25 am

Post by matte2k » Sun Nov 24, 2013 4:53 am

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!

Active Member

Posts

Joined
Thu Mar 01, 2012 7:07 pm

Post by Anthony1632 » Thu Feb 13, 2014 8:07 pm

Wanted to have a go with this but it seems the module is not stable enough. If this is SO good why the developper is not working on a paid version (or still even free) that works perfectly. As i see it there is a 50% success rate. Hoping that this module will get improved in the near future and better support and more stable.

Anyway....you guys give a lot of suggestions and support here to people who has problems or want to make this work.

Cheers,

Active Member

Posts

Joined
Sun Oct 14, 2012 10:02 am

Post by IP_CAM » Mon Jul 07, 2014 1:02 am

My most efficient .htaccess solution. I am, so far, not using the 'smartoptimizer' Option.

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/
to the name of the 'Sub' where your shop is placed.

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/
Last edited by IP_CAM on Fri Oct 02, 2015 8:58 am, edited 1 time in total.

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.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Anthony1632 » Mon Jul 07, 2014 10:12 am

Hi Ernie,

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 :-)

Active Member

Posts

Joined
Sun Oct 14, 2012 10:02 am

Post by Anthony1632 » Mon Jul 07, 2014 11:17 am

Hi All,

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.

Active Member

Posts

Joined
Sun Oct 14, 2012 10:02 am

Post by Anthony1632 » Mon Jul 07, 2014 12:53 pm

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?

Active Member

Posts

Joined
Sun Oct 14, 2012 10:02 am

Post by IP_CAM » Thu Jul 10, 2014 10:51 am

your question has already been answered here:
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.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by VictorDrummond » Thu Jul 10, 2014 9:38 pm

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?
Is your store in public_html or in public_html/shop ?

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.


User avatar
Active Member

Posts

Joined
Sat Dec 15, 2012 12:41 pm
Location - On the balcony slammin' Margaritas

Post by Anthony1632 » Thu Jul 10, 2014 9:45 pm

public_html

RewriteBase /

Active Member

Posts

Joined
Sun Oct 14, 2012 10:02 am

Post by raj79 » Sun Jul 13, 2014 8:20 pm

we are getting same speed.


we are using latest version for opnecart.

Online Grocery shopping in delhi


New member

Posts

Joined
Fri Jun 06, 2014 3:57 pm
Location - Delhi

Post by IP_CAM » Mon Jul 14, 2014 4:22 am

it's rather difficult to get clear results, because I already implemented
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:

Image

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.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Anthony1632 » Mon Jul 14, 2014 10:37 am

It also varies where your site is hosted and from where it is accessed from. If your hoster is in Denmark then the site will perform very good in Europe and less in Asia.

Active Member

Posts

Joined
Sun Oct 14, 2012 10:02 am

Post by IP_CAM » Mon Jul 14, 2014 11:39 am

Not really, it's the Setup, what makes the difference.

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.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by reginamor » Sun Oct 12, 2014 7:08 am

Hi!! i have problems with the htacces
when i add the code that you give, then could not found de files css, js, etc

how can i fix it?

User avatar
Active Member

Posts

Joined
Wed Sep 21, 2011 4:44 am
Location - GB

Post by IP_CAM » Tue Oct 14, 2014 8:29 am

did you do this right??
----
# 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.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by intelcom » Fri Oct 17, 2014 8:38 pm

We use this for 1.5 year now with no problem.

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. :choke:

We contact Paladin support but they answer us that is not Paladin Fault.

So can you help us? :)

User avatar
New member

Posts

Joined
Wed Apr 11, 2012 4:33 am
Location - Thessaloniki Greece

Post by fbranco76@gmail.com » Tue Mar 03, 2015 2:14 am

Hi, what i need put on index.php on ../ and config.php???
i unziped files and after css, js and animations of website doenst work...


Posts

Joined
Tue Mar 03, 2015 2:11 am

Post by IP_CAM » Wed Mar 04, 2015 1:01 am

You don't need to put anything on your index oder config files, it already has been done, as you installed the software.
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.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Dizzyua » Sat Mar 14, 2015 7:11 pm

When i add code in tag ##SmartOptimizer## all images has gone and not showing :(
All code between ##SmartOptimizer## working but when i insert ##SmartOptimizer## and next code with end ##SmartOptimisre## site has crashing :(

Newbie

Posts

Joined
Fri Aug 30, 2013 6:29 am
Who is online

Users browsing this forum: No registered users and 40 guests