by Chris Cummings | Aug 14, 2018 | Google, htaccess, HTML, SEO, Wordpress
Enable Gzip and browser caching code. Add to the bottom of the .htaccess
# LBROWSERCSTART Browser Caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif "access 1 year"
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/javascript "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/xhtml-xml "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresDefault "access 1 month"
</IfModule>
# END Caching LBROWSERCEND
# START GZIP ENABLING #
<IfModule mod_deflate.c>
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
</IfModule>
# END GZIP ENABLING #
by Chris Cummings | Nov 4, 2015 | Google, SEO, Wordpress
When running a site through Search Console, Google started crying and complaining that I didn’t have author or date micro data. Boo frickin’ hoo! 😉
Anywho I search for a while, tried a few things and found this code that fixes it:
Add this to your functions.php in your CHILD theme (you better be using a child theme, mister!)
//code to make google search console happy about microdata
function add_atom_data($content) {
$t = get_the_modified_time('F jS, Y');
$author = get_the_author();
$title = get_the_title();
if (is_home() || is_singular() || is_archive() ) {
$content .= '<div class="hatom-extra" style="display:none;visibility:hidden;"><span class="entry-title">'.$title.'</span> was last modified: <span class="updated"> '.$t.'</span> by <span class="author vcard"><span class="fn">'.$author.'</span></span></div>';
}
return $content;
}
add_filter('the_content', 'add_atom_data');
It’s here: https://thomas.vanhoutte.be/miniblog/missing-updated-wordpress/
by Chris Cummings | Mar 17, 2015 | SEO, Wordpress
Check these out, they MIGHT help with performance (note that at least 1 will not work on GoDaddy’s managed WP):
by Chris Cummings | Apr 20, 2012 | htaccess, SEO
I’m a bit new to this side of things but for now this is the .htaccess file I’m using when I want everything to point back to http://www.site.com/
EDIT: I updated on 5/20/13 and 8/15/13 to add several options that can be removed.
RewriteEngine on
# Proper 404
ErrorDocument 404 /404.php
# 301 Redirects of old page names
RedirectPermanent /old-page.php http://www.site.com/new-page.php
# Force index.php to go to root
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://www.site.com/$1 [R=301,L]
# Force www
RewriteCond %{HTTP_HOST} !^www.site.com$
RewriteRule ^(.*)$ http://www.site.com/$1 [R=301]
# Allow with or without PHP extension
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.php [NC,L]
# Force trailing slash
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ http://www.site.com/$1/ [R=301,L]
Also I should have figured this out years ago but I shouldn’t just reference index.php and the like in an href, do it up right with the full URL http://www.site.com/
by Chris Cummings | Jan 30, 2012 | SEO, Web Design, Wordpress
Mainly what you have to do is:
- Convert the site to WP
- Once all is good with WP edit .htaccess
- Above all the wordpress stuff you have to add this type of thing: Redirect 301 /myoldurl.html http://mydomain.com/newpagename
- You have to add that for each old file that you want to redirect to the new file
- There is info all over the net, including here: http://stackoverflow.com/questions/3696002/converting-a-static-site-to-a-wordpress-site-how-to-transfer-convert-seo-ranki
by Chris Cummings | Jan 27, 2012 | SEO, Web Design
This is a bit web design related and a bit SEO related but basically watch this video:
http://www.google.com/search?client=safari&rls=en&q=canonical+matt+cutts&ie=UTF-8&oe=UTF-8#q=canonical+matt+cutts&hl=en&client=safari&rls=en&prmd=imvnso&source=lnms&tbm=vid&ei=VpYhT57qHcqBgwfXy4D1CA&sa=X&oi=mode_link&ct=mode&cd=4&ved=0CBEQ_AUoAw&bav=on.2,or.r_gc.r_pw.r_cp.,cf.osb&fp=cb0215ac689da41e&biw=1089&bih=1024
Then check these sites on how to fix it.
http://knowledge.freshpromo.ca/seo-tools/301-redirect.php
http://www.barrywise.com/2008/10/seo-canonical-urls-and-301-redirects-in-windows-iis-6-iis-7/
http://www.searchenginepeople.com/blog/hwoto-canonical-headers.html