I have moved a website to another subdomain and some of the hard coded link are causing problem.
Original website
<pre>
www.example.com
</pre>
New Website
<pre>
subdomain.example.com
</pre>
Some of the php code in the files reside in the www directory has http://www.example.com in them. How can find the “www.example.com” in the *.php pages and replace them with “subdomain.example.com”. There are in recursive directories as well so I would like to change them.
You can do this easily from the command line via
You can adjust the file set by sending extra parameters to
findand you can do a more sophisticated replacement by adjusting the expression given tosed(for example, to ensure the matched pattern is a whole word).