Post by Lucastar » Sun Dec 23, 2012 4:31 am

Hi everyone.
I have made a ridiculous search engine submission error.
I have also learnt a lot...

I didn't have SEO friendly URLs switched on before I submitted my site map to google.

my non seo urls were getting top 5 placing.
I have since switched on SEO URLs
Now, the old pages direct people to a 'The page you requested is not here!' from Google.
(My seo optimised pages are currently reaching 160th place) :(

Question is: can I send all my 'The page you requested is not here!' traffic to the homepage instead? without generating any errors on Google?
How would I do this??



Other question, Google pagespeed wants me to jump through hoops with minifying Javascript and CSS. deferring page, moving stuff to the bottom of the page - but I dont really understand where/how to do these mods. I have a pagespeed of 83.
I don't know if my .htaccess is correct, but I seem to have got my caching working for desktop.
I have seen some extensions in the store, but they are too expensive for me to buy.
Is there a good guide for doing this on Opencart?

Thanks

Newbie

Posts

Joined
Fri Nov 30, 2012 7:42 pm

Post by Lucastar » Sun Dec 23, 2012 9:04 pm

I redirected any traffic going to the error not found pages to my homepage instead. That seems to have sorted it.


I purchased a script for $15 to minify the HTML and CSS - this added 2 points to my pagespeed rating.
I used .htaccesss file from http://html5boilerplate.com/ which has sorted out my cache validator for 8/12 things. not sure how to fix the last 4 :(
They are image files - png and jpg in catalog/theme and images/cache respectively. (images because I have a subdomain for image files)
My htaccess now looks like this: (- dont laugh, I am a complete newbie, without any programming experience, so if it looks poor, let me know what I am doing wrong, and help me correct it please, instead of just mocking my inexperience?! ha!! ha!!)


# 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 All and FollowSymLinks are disabled on this server.
# FollowSymLinks is automatically replaced to SymLinksIfOwnerMatch, All is changed heuristically.
Options +SymLinksIfOwnerMatch
# Prevent Directoy listing
Options -Indexes

# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------

# These are pretty far-future expires headers.
# They assume you control versioning with cachebusting query params like
# <script src="application.js?20100608">
# Additionally, consider that outdated proxies may miscache
# http://www.stevesouders.com/blog/2008/0 ... erystring/

# If you don't use filenames to version, lower the CSS and JS to something like
# "access plus 1 week" or so.

<IfModule mod_expires.c>
ExpiresActive on

# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"

# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"

# Your document html
ExpiresByType text/html "access plus 0 seconds"

# Data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"

# Feed
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/atom+xml "access plus 1 hour"

# Favicon (cannot be renamed)
ExpiresByType images/x-icon "access plus 1 week"

# Media: images, video, audio
ExpiresByType images/gif "access plus 1 month"
ExpiresByType images/png "access plus 1 month"
ExpiresByType images/jpg "access plus 1 month"
ExpiresByType images/jpeg "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"

# HTC files (css3pie)
ExpiresByType text/x-component "access plus 1 month"

# Webfonts
ExpiresByType font/truetype "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"

# CSS and JavaScript
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"

<IfModule mod_headers.c>
Header append Cache-Control "public"
</IfModule>

</IfModule>



# ----------------------------------------------------------------------
# ETag removal
# ----------------------------------------------------------------------

# FileETag None is not enough for every server.
<IfModule mod_headers.c>
Header unset ETag
</IfModule>

# Since we're sending far-future expires, we don't need ETags for
# static content.
# developer.yahoo.com/performance/rules.html#etags
FileETag None


<IfModule mod_deflate.c>
<FilesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
# compress the files
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
# removes some 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
# 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

# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>

# 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]
# Prevent Directoy listing
Options -Indexes
### 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





Things I have got nowhere with yet....

Defer parsing of JavaScript - I dont have a clue where to start with this :(
I understand that I need to move the js stuff to the bottom of the page.. but which file???

I have installed cloudflare cdn, but my dns has not updated yet, so I can't give any feedback.


It would be great if someone with far more knowledge than me had written a guide on 'optimising Opencart for Google Pagespeed'

Anybody know of such a thing? I seem to have been searching most of the night :(

Newbie

Posts

Joined
Fri Nov 30, 2012 7:42 pm

Post by ForgetfulGuru » Sun Dec 23, 2012 10:18 pm

Hi Lucastar, I don't have answers to your issues I'm afraid, just empathy with your questions.

I too am in the same situation, and have applied most if not all of the same fixes. Except buying the script for minifying the html, js and css. I thought that was what CloudFlare did on the fly. Turns out it doesn't do so well with the free account on css files G-pagespeed stills tells me I need to compress all the css on site. Have installed min from GitHub to do the same, but will need to learn first and then test.

My biggest issue I think (novice ponderings mostly) are the images used on site. Downloaded the whole image cache folder and ran them through http://www.smushit.com/ysmush.it/

I tried adding JavaScript to the bottom of the page as suggested, broke everything, the only one I have left there is the js cookie file. It was suggested through pagespeed to inline some small js as well. Turns out that's quite easy and was only one file. tabs.js in the jquery folder. Minified and added to the product.tpl file just above the tabs section. I went through each call to .js in the header.tpl and added defer to the script tag, again seemed to break the page. Think it depends on what the file is doing for you and when it needs to do it. script tags should look something like this.

Code: Select all

<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.colorbox/1.3.20.1/jquery.colorbox-min.js" defer></script>


Also added a call to cdn version of the file through CloudFlare, only worked for some of the files again depending on what the file does for your page and when it is needed. (I think) Tried Google's code suggestion for deferring JavaScript, but ran into a new issue. How does a novice decide which JavaScript functions can be deferred?

I am using the same boilerplate .htaccess and have seen good results from it with a little tweaking of the times, you did remember to copy over any OpenCart and OC add-on's rewrite rules I hope. Think they might be needed for SEO URLs.

Anyway, I'll be keeping an eye on this thread as I will be needing some of the same answers.

All the best Billy

Life is for the taking. It's everything else you need to pay for.
Anne Makes Lovely Candles


User avatar
New member

Posts

Joined
Sun Jul 22, 2012 11:12 pm
Location - Left hand corner as you enter the room, better feng shui.

Post by ForgetfulGuru » Sun Dec 23, 2012 10:40 pm

Although, one thing that does cheer me up is my newest pagespeed (Page Speed Grade:(97%)) and yslow (YSlow Grade:(96%)) scores. here is the test page. GTmetrix. Not bragging of course, well really I am and *!%**$% chuffed as well. A week ago they were at 69% and 62%. Onwards and upwards.

Billy

Life is for the taking. It's everything else you need to pay for.
Anne Makes Lovely Candles


User avatar
New member

Posts

Joined
Sun Jul 22, 2012 11:12 pm
Location - Left hand corner as you enter the room, better feng shui.

Post by Lucastar » Sun Dec 23, 2012 10:41 pm

Cheers Billy,

Im not sure how a novice like myself is supposed to understand any of this - everything is written for people who have experience - especially the Google 'learn more' files from their Pagespeed - I read someone else was unimpressed with that too..
I got annoyed with Cloudflare, because I couldnt login and adjust my settings. I'm not sure If I typed my email incorrectly when I signed up, or what..
So I tried to make a new account, but can't because my http://www.york3dprinters.com address is already registered with them. I've emailed them, but I doubt I will get a response now until after new year. :(
I have changed my nameservers back to original settings, but I dont know if the installation process that I went through with the Cloudflare website has made modifications to my server.
All I do know is that when I go to http://www.webpagetest.org I no longer get images showing in the preview windows, So I can only presume there are no images being served. *GROWLS*
This is really frustrating - I wish I had never gone there. I was already getting 3.5second initial, and 1.6 second repeat pages, and 85Google Pagespeed. hmm

As for the boilerplate .htaccess, I just stole and pasted into the original Opencart Script :

Expires headers (for better cache control)
and
ETag removal.
It didn't fix all my issues, but it removed 8 of them, and thats better than none. I wish I knew more about PHP, but I really just want to run my business!
Cheers,
Aidan

Newbie

Posts

Joined
Fri Nov 30, 2012 7:42 pm

Post by ForgetfulGuru » Mon Dec 24, 2012 3:58 am

Hi yes the google stuff does seem like they think everyone has a degree in something related to the subject or is making enough money to employ a whole web team, wish! wish! wish! Never know what Santa "will" bring, but I know what he's not turning up with.

As for your link issues have you tried clearing everything from webmaster and re-uploading a new sitemap? don't know if that will do anything but it's all worth a go.

I also had issue with CloudFlare and emailed them my question. Got a nice reply yesterday, only took a day, basically I'm on a free account so don't expect anyone to rush to find an answer any time soon (paraphrased of course). You would think they would have an easier way to recover login and passwords though.

No mods to your server, I don't think, just on-the-fly changes to the pages that go through their service. Script and css files loaded from them instead of from your server. Images severed from multiple servers (allegedly) to spread the load.

If you check your pages with view source in any browser You'll see there is no reference to CloudFlare at all.
I check mine after a couple of hours of the service being active, swapped the name servers back, again just to check.

if there was another free option I would try it, I really have only just started in eCommerce and making no money at all at this time.

I popped on to your site and the images are conspicuous by their absence right enough. Have you tried manually clearing the cache folder?
I would use an FTP program fileZilla is good. navigate to:
/image/cache/data and delete the lot. that forces the OC system to rebuild the image cache. might fix it, might not, but it wont break it.
Also after a further look the img scr ref is pointing at you subdomian address. Have you checked this is still pointing at the correct folder on your cpanel?

Sorry if I'm point out things you've done already
Billy

Life is for the taking. It's everything else you need to pay for.
Anne Makes Lovely Candles


User avatar
New member

Posts

Joined
Sun Jul 22, 2012 11:12 pm
Location - Left hand corner as you enter the room, better feng shui.

Post by Lucastar » Thu Dec 27, 2012 6:12 pm

Hi Billy, thanks for the advice.
My site is working again now.. took a while - yes, I had tried empying the cache - thanks for that advice.
I'm not sure what was going on with Cloudflare, and the subdomain - but I eventually got rid of the nasty stuff.
In fairness, they did say that they would help me get it working if I wanted to try again, but I have realised that any site with an SSL that is not on a subdomain (ie. my site) would have to be set up in a 'paid' account.
Well.. If they want cash from me, they better sort out their programming first, and make the whole thing a little more friendly.
You can't remove a Cloudflare account when you have opened it. I spoke to their tech support who agreed that the interface was 'clunky'

Then, to make matters worse, when I changed back to my original nameservers, I mistyped, and put a full stop in the wrong place :(
Anyway, working now, and pagespeed is 86 desktop, or 79 mobile.

I've got to work out how to 'defer parsing of javascript' next.... but I am getting the nagging feeling that I should pay someone to do this for me... I know enough about webservers and hosting to build a page, and get myself into trouble; but I'm no good at the indepth stuff that goes with it, so if anything unusual happens, I land on my ass. :(


Anyway - cheers for the link to the social button maker #(not the fairy!) I had not seen this before - really useful. I will get one when I have a few minutes spare. :)

http://www.York3dPrinters.com is my first ecommerce site too, (and I know that there is lots wrong with it) - big learning curve, but I am (slowly) getting wiser!
I made a big mistake with my incorrect URLs listed on Google though, I removed the links from Google, instead of redirecting them, and have since gone from 1-3rd place on Google to 61st - oops :(
Never mind! Climb, Climb again!!

Newbie

Posts

Joined
Fri Nov 30, 2012 7:42 pm
Who is online

Users browsing this forum: Bing [Bot] and 49 guests