Jump to content

REmoving WWW and top level domain


webboy

Recommended Posts

Hi all I m a very new hereto coding.

I have been playing around with PHP and wish to have my domain display without the prefix also suffix

eg have www.mydomain.co.uk  by usign the $_server[...

How do i remove the www also the .com or .co.uk from the information ? so i am left with mydomin
Link to comment
Share on other sites

Yes I was thinking along those lines
but as I have no idea how to program php.. Could anybody help here

as I all I wish to achieve is every time I wish to print the domain name I don't have to retpy the info as it site will be moved and replacted 
ahh just thinking out loud I will look up  in dreamwever to do a left$
Link to comment
Share on other sites

If you have NO idea, it'd be quicker to pay someone to work on it for you. If you're learning PHP, it'd be good for you to try to figure it out from the documentation.

A quick solution would be to have one var with the domain and just change it when you move it.
$domainURL = "mydomain.com";
When you move, change to
$domainURL = "mynewdomain.com";

and then just <?=$domainURL?> when you need it.
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.