php - Reroute all links on page to localhost -


i doing minor re-work on friend's site. have downloaded has currently, of links absolute links, whenever navigate within locally hosted site, pushed live site. instead of overwriting of links (on each page, in database, etc.), "reroute" links going "www.google.com" example "localhost/project". there easy way htaccess file? should mention wordpress site, if there other way go this.

there several ways:

1) edit /etc/hosts.txt file , add line "127.0.0.1 www.google.com". (that file in system32, think windows) don't forget remove entry when you're done.

2) search-and-replace on files while editing. perl -i.bak -pe 's/www.google.com/localhost/' *.html work.

3) use proxy can modify data. https://github.com/evaryont/mousehole

4) use greasemonkey or similar modify page via javascript.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -