Page 1 of 1

Change server path?

Posted: Sat Aug 20, 2005 10:12 am
by tsg
Hey all,

I have a client that now after I have developed the website, they added all the content, created hundreds of pages, are wanting to move to another server.

In all the pages that are created, basically the create:

Code: Select all

<?
$page_id = 65;
include "/home/user/public_html/pages/index.php";
?>
Well, the new server, the paths are not even close. Is there a way to change the path on that server? a mod rewrite or something?

Thanks,
Tim

Posted: Sat Aug 20, 2005 10:45 am
by feyd
this is why it's recommended to use relative includes, versus literal. You will need to fix the code parts. Using a rewrite or other thing simply hides the problem and takes longer (granted not a lot) to process.

Posted: Sat Aug 20, 2005 11:18 am
by tsg
Thanks, but I am looking for an alternative to changing the path on hundreds of pages. Is there another way to do it? With a rewrite? If so, can someone point me in the right direction for this?

Thanks,
Tim

Posted: Sat Aug 20, 2005 11:29 am
by feyd
the only way it may be possible is through a symlink, which you may not be allowed to create. It's best to just fix the files. There are editors/tools out there that can find and replace things (using regular expressions sometimes too) among a large group of files.

Posted: Sat Aug 20, 2005 3:20 pm
by bokehman
You should be able to create a script to open all the files and modify them.