accessing scripts

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bhm8hwcm
Forum Newbie
Posts: 9
Joined: Mon May 05, 2003 10:53 am

accessing scripts

Post by bhm8hwcm »

I am looking to host a few sites and I would like to use many of the same scripts on each site. For example if I have a common login.php page. I want to use the exact same script for each site but I do not want to have to put this script in the root of each site.

My question is how do I reference this page. If I have a menu item going to http://www.something.com/login.php but login.php will not actually exist in the doc root. Is this possible?

I am also using Smarty.

Any help is appreciated.
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

Read about mod_rewrite. If you do not want to put login.php in the root dir you can create a login directory and put login scripts there :P :).
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

You can also set up "virtual directories".

In apache you simly add

Code: Select all

Alias /scripts &quote;/path/to/files/&quote;
in httpd.conf and restart the server to allow http://www.site.com/scripts/ to point to a particular folder not in the web root ;)
Post Reply