A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Redirects behave weirdly in Chrome

Chrome (un)helpfully caches redirects sometimes.
Try using an incognito window and the behaviour should make more sense.

Moving a wordpress e-commerce site

  • UPDATE wp_options SET option_value="http://newsite/new_dir" WHERE option_value="http://oldsite/old_dir"; -- this fixes most of the site
  • UPDATE wp_options SET option_value="http://newsite/new_dir" WHERE option_value="http://oldsite/old_dir"; -- this fixes the pagination for the e-commerce plugin.
  • In .htaccess:

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f [NC]
    RewriteCond %{REQUEST_FILENAME} !-d [NC,OR]
    RewriteCond %{REQUEST_URI} / [NC]
    RewriteRule ^(.*)$ /new/$1 [L,QSA]

Importing with Wordpress

If you get a 500 Internal Server Error while importing a large file in Wordpress:

  • Just keep refreshing the page and re-submitting the data.
  • Items will continue to be added (and downloaded) a few at a time, and no item will be added twice.
Eventually all the data will be imported correctly.

Move directory on FTP server

without downloading and re-uploading:

rnfr source_dir
rnto target_dir