htaccess redirect www to no-www and remove index.html

This is a useful generic rewrite instruction to insert into the .htaccess file:

Rewrite

RewriteEngine On

#http://www.*/blabla.xyz —-> http://*/blabla.xyz

  1. RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  2. RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

#http://*/xyz/index.html —-> http://*/xyz/

  1. RewriteRule ^index\.html$ / [R=301,L]
  2. RewriteRule ^(.*)/index\.html$ /$1/ [R=301,L]

Other useful rewrite rules for rewriting the home to a given file or directory:

  1. RewriteRule ^$ /myfile.html [R=302,L]
  2. RewriteRule ^$ /mydir/ [R=302,L]
Bookmark and Share

Posted in: php

Tags: , , , ,

Solve Media plug-in in Wordpress and PHP editing

just a remind:

the instruction require_once(”solvemedialib.php”); should not be added if you are programming some PHP code inside Wordpress as it cause compatibility issue and interrupt the execution of your script.

Bookmark and Share

Posted in: Wordpress, php

Tags: , , , , ,

Import and Export physical hardware, tax laws and so on

Not exactly a technicality but if you need hardware these information will serve to the purpose:

Final Price = [(Price + Frontier Duty) * V.A.T] + Fix Price

Let’s make an example:

in the case of Italy,

  • Price: your actual price at the shop/factory
  • Frontier Duty: in case of electronics 0% (*)
  • VAT: 22%
  • Fix Price: 11 Euro (**)

(*) more information for IT at https://aidaonline7.agenziadogane.it/nsitaric/index.html and http://www.agenziadogane.it/wps/wcm/connect/internet/ed/cittadino/rimborso+iva for CH at http://www.ezv.admin.ch/zollinfo_firmen/04016/index.html?lang=it and http://xtares.admin.ch/tares/login/loginFormFiller.do;jsessionid=v1VTTmtTqkrs1Vvpk9ZJ1pQhpytCpNWghxB6bY1Hdw1Y75Z1ftvN!-398697991

(**) Prestazione doganale: 2,50 euro; spese postali: 3,00 euro; DAU: 5,50 euro; TOTALE: 11 euro circa

Bookmark and Share

Posted in: Quick Fix

Add extra pages in the XML site map of Wordpress

the XML site map plug in does not insert all the pages in the Sitemap.xml. In particular, in the case of online shops this result in the impossibility to add the product pages in the fine. Thus reducing the visibility of the products.

The best way to overcome this is to use the All in one SEO plugin in order to generate a second site map that should be inserted in google webmaster tools and bing.

Example:

Bookmark and Share

Posted in: Wordpress

Tags: , , ,

On Modify the google merchant feed produced by wp-ecommerce

Check if the file “wp-e-commerce/wpsc-includes/productfeed.php” contain the following piece of code:

if ( is_array ( $product_meta ) ) {
foreach ( $product_meta as $meta_key => $meta_value ) {
if ( stripos($meta_key,’g:’) === 0 )
$google_elements[$meta_key] = $meta_value;
}
}Check if the che

if ( is_array ( $product_meta ) ) {

foreach ( $product_meta as $meta_key => $meta_value ) {

if ( stripos($meta_key,’g:’) === 0 )

$google_elements[$meta_key] = $meta_value;

}

}

if the answer is “yes” you can add attributes that start with “g:” in your custom meta and they will be inserted into the feed
Bookmark and Share

Posted in: Quick Fix

Tags: , , , ,

Rolling back to previous Wordpress Versions

Here is the procedure:

  • 1) download the previous version at Wordpress release archive
  • 2) make a backup of (i) home folder (ii) wp-admin  and (iii) wp-includes (*)
  • 3) replace, using FTP, the current version of the mentioned folders and files with the version that you just downloaded (*)
  • 4) long in WP and update the DB as requested
  • 5) have fun!

(*) Note: do not touch the wp-content folder

Bookmark and Share

Posted in: Quick Fix, Wordpress

Tags: , ,

Landing Page for Facebook

Interesting way for achieving 2 goals:

  • Suggest to your visitors to like your Facebook page
  • Give them a reward it they do that

Bookmark and Share

Posted in: Facebook, Wordpress

Tags: , ,

Tuning SEO and Jetpack for posting in your Facebook page

Using Jetpack in Wordpress is no pain for most of the procedure. Just need to be aware that:

  • The facebook plug-in creates some conflicts with Jetpack
  • This is a useful page for debugging the API of Facebook
  • All In One SEO can be used for adding the missing information if properly configured

For more information you can refer to this discussion in the Jetpack support page

Bookmark and Share

Posted in: Facebook, Wordpress

Tags: , , ,

Sourceforge and MediaWiki internal error. Exception caught inside exception handler.

Found a quick fix for the Google Analytics integration in mediawiki. At the following link there is the bug report:

http://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration#Bugs

the solution was removing an $ at line 32 of the googleAnalytics.php file

and now the IE wiki is perfectly functional!

Bookmark and Share

Posted in: MediaWiki, Quick Fix

Tags: , ,

Remove Comments in Wordpress pages

There is a secret button for do this!

  1. click on pages
  2. chose a page and click quick edit
  3. the checkbook is on the right side
Bookmark and Share

Posted in: Quick Fix, Wordpress

Tags: , , ,