Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Shared Hosting Support

Notices

Reply
 
Thread Tools
  #1  
Old 03-11-2005, 04:05 PM
MyCollegePost.com MyCollegePost.com is offline
Hatchling Croc
 
Join Date: Jan 2005
Posts: 37
Default Creating a symbolic Link to a php file

How do I create a symbolic link to another php file in a different directory?

Currently I have the following:

Directory 'USC' with index.php in it

I want to make another directory 'SDSU' which also has index.php in it, but I want it to a be a link to the index.php in USC. This way changes only have to be made on the main index and they propergate throughout all the different folders.. Thanks guys!
Reply With Quote
  #2  
Old 03-11-2005, 04:37 PM
JZ JZ is offline
Swamp Croc
 
Join Date: Aug 2004
Location: Harrisburg, PA
Posts: 364
Default Re: Creating a symbolic Link to a php file

Well, cpanel doesn't have the ability to do this and you do not have access to shell.

So, here we go with perl again.

Create your directory structure and write your code something like this. I just named it test.pl

Code:
#!/usr/bin/perl -wT

symlink("/home/username/public_html/USC/index.php","/home/usrname/public_html/SDSU/index.php");
You can save it anywhere, I did it in my cgi-bin directory. Make sure you upload in ascii and chmod 755. Just point your browser to www.yourdomain.com/cgi-bin/test.pl.

Note: you will get an internal server error an no output, but the symbolic link will still be created if everything was done correctly.

-Jay
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating A sub-domain to link to webmail MyCollegePost.com Shared Hosting Support 0 01-14-2005 01:58 AM
[Closed] Errors accessing php pages via secure link alikai Shared Hosting Support 2 07-24-2004 10:23 PM
[Closed] PHP Problem nate_s_ Shared Hosting Support 3 06-07-2004 03:48 PM

All times are GMT -5. The time now is 01:05 PM.