Jump to content

[SOLVED] Subdomain problem


web_master

Recommended Posts

Can I ask why you can't just link directly to the page with the full url?  Are you looking for some code you can put on multiple pages or something?  As far as I know there is no way to do it but let me know why and I think I may have a few ideas for you.

Link to comment
Share on other sites

OK, I will try to explain,

 

I made a site on domain with name example: www.black.com

the customer who order the site watch my work, mean how I build the site and if he want some changes, he tell me. The customer is the provider, that mean when I finish the site he will "simple rename" the domain into www.white.com. So, if I use full links in files, I will need to change all the links after rename of domainname...

 

I hope is understble...

 

Link to comment
Share on other sites

Use something like this.  Should work on all domains...

 

<?php

function domain()
{
  $url = explode (".",$_SERVER['HTTP_HOST']);
  $count = sizeof($url);
  echo $url[$count-2].".".echo $url[$count-1]
}

domain();

?>

 

Just create an function in an include file and call it from a page and that should print the url by itself

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.