Web Site Search

General discussions about Advanced Find and Replace
Post Reply
anmldr
Posts: 19
Joined: Mon Jan 31, 2005 5:32 pm

Web Site Search

Post by anmldr »

Is there a way to have AFR search through my web site and perform replacements vs. having it search through files that are located on my desktop computer?

My web site host has changed the directory of the https: pages and it is necessary for me to change all of the links on my web site pointing to the https: order pages.

I know that I can download a copy of my web site, use AFR to find and replace the outdated links and then upload the pages again, but it would save a LOT of time if AFR could do this in a directory on my web site instead.

Is this possible?

TIA,
Linda

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Post by Abacre »

Hi,

Well, technically it's possible if your remote host (server) is
running under Windows platform. If it's under Linux/Unix then AFR
would not run there.
You should simply upload AFR to remove server. But previously you
should turn and test AFR very carefully on your local computer.

Basic highlights of what should you do:
For turning and testing purposes download all your pages to your local
computer. For example, into:
c:\InetPub\wwww\
create scripts directory:
c:\InetPub\wwww\scripts
or c:\InetPub\wwww\cgi-bin
It should be perfect if you have IIS or Apache (the same web server as
on your remove host) on your local computer so you could test it carefully.
so copy afr.exe and default.cfg into c:\InetPub\wwww\scripts
Try to run it manually:
c:\InetPub\wwww\scripts\afr.exe
Set "search path" to c:\InetPub\wwww\
Set needed file masks.
Specify operation and search for/replace with pairs.
Very important: uncheck "Confirm before replace/batch replace"
parameters and "Make text preview" option. If you have "confirm before
replace" checked on then when the program runs on remove server it
will display dialog on remote server asking for confirmation. I you
could not "press OK" on remote server. This is a most important thing
why it is not advised to run the program on remote server.

So verify now that program works correctly.

after that create BAT file. for example start.bat
and you will call AFR using this file. put start.bat into c:\InetPub\wwww\scripts\
inside start.bat you should put needed text:
afr -execute:replace -searchfor "Hello World" -replacewith Hi -config -min -exit

Very important: you should always specify -exit parameter. Because
the program should be automatically closed on remote server.

Read more about command line parameters here:
http://www.abacre.com/afr/manual/commandline.htm

So you have to give access right to execute scripts in c:\InetPub\wwww\scripts\
Then you can make "Complete Local Test" of you local configuration:
You may run script:
http://localhost/scripts/start.bat

If everything was turned fine the program should run normally.

Then you may upload afr.exe, default.cfg and start.bat onto remote host into
scripts directory. You should give rights to start the applications in
scripts folder. Set correct search path in your default.cfg because
search path in remove host is different.

So theoretically it will work. It's recommended to spend some time for
setup if you are going to run such scripts quite often.
But if you need it just once: I would download all pages on local
site, replace it and then I would use Abacre Web Site Uploader which
uploads only needed pages on remote host.
It's quite strange how do you want with your site? Because it it
normal practice to work with web pages locally and then upload it
using synchronization utilities like Abacre Web Site Uploader.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

anmldr
Posts: 19
Joined: Mon Jan 31, 2005 5:32 pm

Post by anmldr »

Thank you for your long and considered answer Roman. I will do it the normal way of running AFR locally on my desktop computer and then upload the changed pages.

Signed,
A definite fan of AFR.
Linda

Post Reply