Apache: How to Redirect All Root Domain Traffic to Subdomain

Problem: Traffic comes to http://krevatas.net/{something} but they really need to go to http://kostas.krevatas.net/{something}. Solution: 301 Redirect via Apache with mod_rewrite. Simple easy addition to your httpd.conf or .htaccess, I placed mine right above my wordpress mod_rewrite rules. If you are using .htaccess just dump it in that file above the wordpress redirect, if you having…

Get substring between two strings PHP

Right below lies a function that returns the string between two other strings. That’s it.

Source : http://stackoverflow.com/questions/5696412/get-substring-between-two-strings-php