Changing link from www.example.com to www.example.com/page

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
praisehim
Forum Newbie
Posts: 3
Joined: Sat Nov 10, 2007 6:11 pm

Changing link from www.example.com to www.example.com/page

Post by praisehim »

Good evening all! I have a config file written in PHP that tells my website how to set link paths. Currently I am running the website on http://www.centalks.com, but I want to change the paths so the instead of going to centalks.com it would go to the virtual host folder ie. http://www.centalks.com/vhost. I have used $_SERVER[HTTP_HOST] to define centalks.com

Code: Select all

<?
//set the path infomation

define ("_HOME_ROOT_", dirname(__FILE__));
[color=red]define("_HTTPS_HOST_", "http://" . $_SERVER[HTTP_HOST]");
define("_HTTP_HOST_", "http://" . $_SERVER[HTTP_HOST]");[/color]
define("_HOME_URL_", _HTTP_HOST_."");
define("_DOC_URL_", "");
define("_INCLUDE_", _HOME_ROOT_ . "/include");
define("_LANGUAGEBAG_DIR_", _HOME_ROOT_ . "/language");
define("_TEMPLATE_", _HOME_ROOT_ . "/template");
define("_UPLOADS_", _HOME_ROOT_ . "/uploads");
define("_CSS_", _DOC_URL_ . "/stylesheet");
define("_SCRIPT_", "/scripts");
How would I direct all my links to http://www.centalks.com/vhost instead of http://www.centalks.com? I know that I have to change the coding in the red, but I don't know what to change it to. All help is appreciated.

Thank you in advance
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

What type of server are you using?
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Post by JAB Creations »

Server's headers say Apache...

.htaccess

Code: Select all

Redirect permanent /1 http://www.centalks.com/2
Post Reply