Check string before doing sub
Check for variable to handle index and product page
Merge pull request #16 from rackerlabs/staging

Fix URL link to handle indexand product page