You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Cui Xiaojing-a13339 <a1...@motorola.com> on 2003/05/30 06:53:37 UTC

Link issue after change server

Hello All,

I need to move much HTML files from one server to another server. But in these HTML files, there are lot of link with complete path. For example, using http://<servername>/File1/file.html. Due to the two servers have different <servername>, so need to change the <servername> or change the complete path to relative path after moving. But due to have so many links, it will need so many time to change it. Are there any other method to solve the issue? Thanks a lot.

Regards,
Xiaojing
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Link issue after change server

Posted by Jason Bainbridge <ja...@jblinux.org>.
On Fri, 30 May 2003 17:19, Jason Bainbridge wrote:
> Either use an IDE with a search and replace function for multiple files or
> if you have Perl and one of the unix shells try the following from the top
> level directory:

Or even better use this opportunity to make all your links relative, like they 
should be. :)

-- 
Jason Bainbridge
KDE Web Team - http://kde.org 
webmaster@kde.org 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Link issue after change server

Posted by Jason Bainbridge <ja...@jblinux.org>.
On Fri, 30 May 2003 12:53, Cui Xiaojing-a13339 wrote:
> Hello All,
>
> I need to move much HTML files from one server to another server. But in
> these HTML files, there are lot of link with complete path. For example,
> using http://<servername>/File1/file.html. Due to the two servers have
> different <servername>, so need to change the <servername> or change the
> complete path to relative path after moving. But due to have so many links,
> it will need so many time to change it. Are there any other method to solve
> the issue? Thanks a lot.

Either use an IDE with a search and replace function for multiple files or if 
you have Perl and one of the unix shells try the following from the top level 
directory:

find . -name "*.html" -print | xargs perl -pi.bak -e 's/oldserver/newserver/g'

This will do the replacements and create .bak backup files to remove the 
.bak's run:

 find . -type f -name \*.bak -exec rm {} \;

Nb. I haven't tested these particular statements but have similar ones that 
work like a dream in my toolkit at work. :)

Regards,
-- 
Jason Bainbridge
KDE Web Team - http://kde.org 
webmaster@kde.org 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org