Plusnet
Sunday 22nd November 2009Login | Register | Help
Pages: [1] 2

Point a Domain to a subdirectory/folder on ccgi !

  • ffupi
  • Bright Spark
  • *
  • Posts: 368
  • View Profile
« on 10/01/2007, 05:30 »
Hello

In case someone needs to point his/her Domain to a folder on ccgi.

PlusNet does not enable it, but it is possible to do with an .htaccess file.
(Thank you to following posters: 1 , 2, 3, 4 ).

1)
Either your Domain is a first cheap one from PlusNet. In my case I got a second one from http://www.123-reg.co.uk/ , which is cheaper than a second one from PlusNet.

2)
Then I logged in at 123-reg to "your control panel", choose "Modify domain" , and then "Change Nameservers". I entered the 4 nameservers of PlusNet:
ns1.force9.net
ns2.force9.net

ns2.plusnet.co.uk
ns1.plusnet.co.uk

Then clicked "Change Nameservers".
It can take up to 72hours, but it was changed immediately (can be checked for uk-Domains on www.nominet.org.uk, enter domain box on first page, right top).

3)
With PlusNet Customer Support I raised a ticket to "to set up "Domain hosting only" and "Domain-email" for my new Domain, so that I can access it on my PlusNet-"domain control tool". ".
In this I followed their guideline.

4)
I raised a second ticket when after 2 days I still could not access my "domain control tool". This is at the menu left on this page, click on Domain names (https://portal.plus.net/m...p;?membermenu=domainnames ). I asked, "Can you please make PlusNet-"domain control tool" accessible." They seemed to have had some problems in my case.

5)
In the domain tool, I clicked under "Existing Domains" on "Configure" beside my new domain.
Under the heading "Domain hosting settings" I set it to "Other", then clicked "Configure DNS Records".
There I set "Left Field" to "www", "Type" to "CNAME", left "Pri" empty, and "Right Field" to "ccgi.plus.net." with a trailing dot (!) .


Then clicked "Add".

Back to the domain tool main page the new DNS record shows up under the heading "Additional DNS records (Advanced)". Fore to save the setting I clicked "Submit".
In this I followed this guideline.

6)
Then I raised a ticket with PlusNet Customer Support to
""Change the CGI service to basic" (this will create the necessary records on the CGI and DNS servers to correctly point the domain to your files on the CGI server.)". Following the tutorial.

7)
Shortly the domained pointed to my ccgi space, to the root. It is not possible with PlusNet to point it to a folder. However my page is in a folder, call it "my folder", on ccgi.

8 )
I added to the .htaccess file in the root of my ccgi following lines (.htaccess tutorial):

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mydomain.co.uk$ [nc]
RewriteCond %{REQUEST_URI} !^/myfolder/
RewriteRule (.*) /myfolder/$1 [L]



Result:
The new domain points to myfolder in ccgi (and searches there for the index file, or the forum index file, etc). In the browser address bar it will not show up "myfolder", but the domain name and straight the files in the folder

It is therefor still possible to go to the ccgi folder by writing in the browser http://ccgi.<plusnetusername>.plus.com.


I believe it is possible this way to have multiple Domains point to different folders on ccgi, by adding these to the .htaccess file?


Hope people will check this and add a few comments.


(Edited to remark, that this line is actually not required:
RewriteCond %{REQUEST_URI} !^/myfolder/  
This is required only:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mydomain.co.uk$ [nc]
RewriteRule (.*) /myfolder/$1 [L]
)

(Edited a second time to add, that it is also possible to redirect the Domain name without www to the subdirectory/folder.)
Logged
  • cirencesterwsc
  • Guest
« Reply #1 on 24/01/2007, 08:28 »
Does exactly what it says on the tin !  Great set of instructions for those knowing little or nothing about htaccess and advanced domain settings.

Cheers
Logged
  • cirencesterwsc
  • Guest
« Reply #2 on 24/01/2007, 13:32 »
Some of my users are still seeing the old site on the www server rather than on CCGI. I'm guessing this is due to the DNS changes not being fully propagated yet as its less than a day since the changes were applied. Will post an update in a couple of days...
Logged
  • pjeffries
  • Guest
« Reply #3 on 24/01/2007, 15:34 »
Here is my scenario

Website1 programmed in php would normally be ccgi.domain1.co.uk, i just want the user to see www.domain1.co.uk

same with domain2

I have a third domain which is using php that will sit on ccgi.domain3.co.uk, i just want the user to see www.domain3.co.uk
However, this domain also has a forum, ccgi.mydomain.plus.com/forum which i want people to see as www.mydomainforum.co.uk

all my websites will be able to link to thie forum but i only want them to see it as www.mydomainforum.co.uk

any ideas
Logged
  • pjeffries
  • Guest
« Reply #4 on 24/01/2007, 15:36 »
Would i need to edit my .htaccess file to look like this

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mydomain1.co.uk$ [nc]
RewriteRule (.*) /myfolder1/$1 [L]

RewriteCond %{HTTP_HOST} ^www.mydomain2.co.uk$ [nc]
RewriteRule (.*) /myfolder2/$1 [L]

RewriteCond %{HTTP_HOST} ^www.mydomain3.co.uk$ [nc]
RewriteRule (.*) /myfolder3/$1 [L]
Logged
  • ffupi
  • Bright Spark
  • *
  • Posts: 368
  • View Profile
« Reply #5 on 26/01/2007, 04:40 »
This seems to be correct.

The domain cannot be changed for the forum other than registering another domain. See this thread.
Logged
  • cbrody
  • Guest
« Reply #6 on 31/01/2007, 23:11 »
I've redirected a domain (hosted by Plusnet) to ccgi but I can't get my .htaccess to work -- any clues as to why this might be?

I have:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.domain.org$ [nc]
RewriteRule (.*) /folder/$1 [L]

Thanks
Logged
  • ffupi
  • Bright Spark
  • *
  • Posts: 368
  • View Profile
« Reply #7 on 01/02/2007, 12:32 »
Hello

It seems to written correctly, my domain works perfectly with the same syntax.

Simple things first, is ".htaccess" in the root of ccgi (first directory structure when opening with a ftp-browser); is it not written ".htaccess.txt"; double-check the domain name is written correctly.

Complicated things, does the domain point already to ccgi: when inputting the domain address into a browser, does the index file in root open? (Is there an index file at all?) Or what happens?

Hope that is of help
Logged
  • cbrody
  • Guest
« Reply #8 on 01/02/2007, 12:36 »
Yes the domain correctly points to the root folder of my cgi space. I have a PHP script there to redirect to the correct directory but the .htaccess file doesn't work. Ity may be that my cgi service isn't set to "basic" (what does this mean?) and I have raised a ticket to correct this.

Cheers

Chris
Logged
  • ffupi
  • Bright Spark
  • *
  • Posts: 368
  • View Profile
« Reply #9 on 01/02/2007, 12:39 »
Hello

Sorry, I have no clue was "set to basic" means, I followed the PN-tutorial. Someone had the same problem before, when set to basic it worked as far as I understood.

ForumBrightSparks might know what "set to basic" means?
Logged
  • cbrody
  • Guest
« Reply #10 on 01/02/2007, 15:28 »
I have been informed that the domain is already set to basic. Any ideas what else it might be?

Chris
Logged
  • ffupi
  • Bright Spark
  • *
  • Posts: 368
  • View Profile
« Reply #11 on 01/02/2007, 18:47 »
Quote
I have a PHP script there to redirect to the correct directory ...

I am not sure if this works against the .htaccess instructions?

What happens actually that:
Quote
but the .htaccess file doesn't work.
?

Does this mean, when browsing to your domain, that the index file in the root of ccgi opens?
Or does the screen remain white?
Does a message come from the browser?

Would like to help, can I have more info?
Logged
  • cbrody
  • Guest
« Reply #12 on 01/02/2007, 23:22 »
The domain points to the root of my cgi space, where I have a php file which does the redirection while I sort out the htaccess problem. (If the .htaccess was working the index.php in the root wouldn't be delivered, would it?) If I remove the redirection from index.php the file is delivered normally.

Cheers

Chris
Logged
  • ffupi
  • Bright Spark
  • *
  • Posts: 368
  • View Profile
« Reply #13 on 02/02/2007, 01:03 »
Understood. The domain points to ccgi - done.

Quote
If the .htaccess was working the index.php in the root wouldn't be delivered, would it?) If I remove the redirection from index.php the file is delivered normally.

OK - correct. .htaccess redirects anything into the directory. Nothing should come through to root (other than using ccgi.<yourplusnetusername>.plus.com).  


What is in the directory to which .htaccess redirects? Is there an index.php set to chmod=755?

Why not testing it in an scenario:
a) Make a directory e.g. "test" into root.
b) Put in it an index.html file with a message, don't forget to chmod=755:
Code:
<html>
<head>
<title>Testing .htaccess</title>
</head>
<body>
If this shows, then .htaccess works. <b>Test done</b>
</body>
</html>

c) Alter the .htaccess file in root to point to "test":
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mydomain.co.uk$ [nc]
RewriteRule (.*) /test/$1 [L]

d) Browse to your domain: http://www.mydomain.co.uk
If now the index.html file delivers its message, then the htaccess-redirect works and the problem is elsewhere.
Logged
  • cbrody
  • Guest
« Reply #14 on 02/02/2007, 01:13 »
I've done the test exactly as described and the rewrite still doesn't work. Not sure what else to try...
Logged
  • ffupi
  • Bright Spark
  • *
  • Posts: 368
  • View Profile
« Reply #15 on 02/02/2007, 10:46 »
Hello, feeling puzzled.

Could I ask about exactly what happens when surfing with the webbrowser to your domain.
Could you PM me your .htaccess file and your domain name, please?

(Surfed to your folder test, and it works, so it is neither a problem with the folder nor the index.html. It must be either the domain or .htaccess).

Often it is a tiny problem, which can crash all.
Logged
Pages: [1] 2
Jump to:  

Related Sites

Community Apps

Here at Plusnet we're always trying to use clever open source things to make our lives easier. Sometimes we write our own and make other people's lives easier too!

View the Plusnet Open Source applications page

About Plusnet

We sell broadband, phone, VoIP and more to homes and businesses in the UK. Winner of 9 out of 11 Categories in the 2008 USwitch survey. Winner of "Best Consumer ISP" at 2008 ISPA awards. Voted number 1 in the Broadband Choices 2008 survey.

© Plusnet plc All Rights Reserved. E&OE

Powered by SMF | SMF © 2006-2008, Simple Machines LLC

Add to Technorati Favourites