How to modify HTML/Themeforest Themes to work in any path statically using unix/linux's sed command -

How to modify HTML/Themeforest Themes to work in any path statically using unix/linux's sed command

For themes and custom CMS setups, the typical HTML theme is not ready to go at all but here are some common sed commands (search and replace that will get most of them working without breaking as you'd expect).

The problem is that often the theme directory will be separate from the content and this will break the relative paths that these themes use.

sed -i s/'href="'/'href="\/themes\/yourtheme\/'/g index.html
sed -i s/'src="'/'src="\/themes\/yourtheme\/'/g index.html
sed -i s/"url(.."/"url(\/themes\/yourtheme\/"/g *.css

In the order of the above

replace all instances of href=" with href="/themes/yourtheme/

replace all instances of src=" with src="/themes/yourtheme/

replace all instances of "url(.. with url(/themes/yourtheme/


  • LG Phoenix 2 Escape Disable AT&T Phonebook/Contacts Error Message
  • mdadm frozen and doesn't realize array is dead/missing failed due to unplugged drives
  • Unable to mount location Failed to retrieve share list from server: No such file or directory solution
  • mdadm how to make inactive array active
  • ImageMagick how to trim white space automatically in Linux
  • curl: (1) Protocol "https not supported or disabled in libcurl"
  • Centos 5 OpenSSL does not support TLS 1.2 Apache Error
  • DRBD Split-brain solution
  • How to Properly Secure SSL/TLS Apache Settings against Heartbleed Poodle (TLS) Poodle (SSLv3) FREAK BEAST CRIME
  • K9 Mail Android Cannot See or View E-mails Disappear after reading - with Dovecot server. Solution
  • The folder contents could not be displayed connection refused - solution
  • Setting Up System for First Use... Please Wait... - WHMCS Installer
  • ERROR 2013 (HY000): Lost connection to MySQL server during query
  • if script bash check if socket file (mysql.sock) exists
  • ioncube loader install howto on PHP/Centos
  • apc_shm_attach: shmat failed: in Unknown on line 0 & apc_shm_create: shmget(0, 67108864, 914) failed PHP Solution
  • MySQLD Server shutdown remotely unexpectedly
  • cPanel Install Error kernel ipv6 module support solution
  • bash count length of string and characters
  • PayPal Subscription Howto Creation Automatic Payments Manual