cancel
Showing results for 
Search instead for 
Did you mean: 

Moving a hosted domain to CGI space

digital
Grafter
Posts: 94
Registered: ‎11-04-2007

Moving a hosted domain to CGI space

I have a domain with Force9 which is 'host only' with the files located within htdocs.
I have created a bulletin board using phpBB3 in my CGI space which I want to link to from the domain but the address, http://ccgi.force9username etc etc is ugly and reveals more than I would want.
I presume I should point the domain at the CGI space and move all of the domain's files into it alongside the3 bulletin board filesbut I can't see how as 'htdocs' is hard wired into the domain location.
Any help would be greatly appreciated!
20 REPLIES 20
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Moving a hosted domain to CGI space

UserTools Tutorial 14 provides guidance on what you need to change in the Member Centre Domain names control panel - see the section Pointing your domain to the CGI server (you can ignore the caveat "not recommended"). Note that for Force9 where the tutorial says 'plus.net' you should use 'force9.net'.
Also don't forget the essential step of raising a ticket to request to 'change the CGI service on your domain to basic'.
David
digital
Grafter
Posts: 94
Registered: ‎11-04-2007

Re: Moving a hosted domain to CGI space

Thanks, just what I needed to know. Job done except I can't FTP to the CGI space: there seems to be a problem with mine, and others, at the moment.
As an aside, is there a way to avoid my Force9 username being shown in the address bar when the site is accessed? I'm seeing http://www.DOMAINNAME/~FORCE9USERNAME/phpBB3/viewforum.php etc etc
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: Moving a hosted domain to CGI space

Quote from: digital
is there a way to avoid my Force9 username being shown in the address bar when the site is accessed? I'm seeing http://www.DOMAINNAME/~FORCE9USERNAME/phpBB3/viewforum.php etc etc

For an explanation of why that's happening, see here. You may need to add the trailing-slash fix suggested there to the rewrite section (after RewriteEngine on) in the .htaccess file of your home folder. If you have .htaccess files containing rewrites at levels below the home folder then see here for a fix. I'm not familiar with phpBB, but if there is a site-url setting somewhere in the prefs, you may have to take the /~username out of that - some packages trip the glitch during setup.
Gabe
digital
Grafter
Posts: 94
Registered: ‎11-04-2007

Re: Moving a hosted domain to CGI space

Thanks for the pointer, but after much reading and experimenting over the last two days I've got precisely nowhere!
The .htaccess file I've found in the root folder of my CGI space contains...
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
The .htaccess file I've found in the phpBB3 folder contains...
#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
#<IfModule mod_rewrite.c>
#RewriteEngine on
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#</IfModule>
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
I've added...
RewriteEngine on
RewriteCond %{HTTP_HOST} ^ccgi\.MYDOMAINNAME\.force9\.net$ [NC]
RewriteCond %{REQUEST_URI} !^/~MYDOMAINNAME/folder/
RewriteRule (.*) /folder/$1
to both but am still seeing ~MYDOMAINNAME in the address bar if the URL is entered without a trailing / (I've changed \.plus\.com in one of the posts I read to \.force9\.net as I've got a Force9 account and the address is cshell.force9.net).
I'd be really grateful if someone could put me out of my misery by telling me exactly what change(s) I need to make.
TIA
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: Moving a hosted domain to CGI space

What you've added is the recipe to rewrite requests for your web-root directory to a subdirectory. That needs to be taken out of the .htaccess file in your phpbb folder. It looks like you already have the trailing slash fix in your root .htaccess, but it needs RewriteEngine on above it. If you still see ~username after that, it may have been set in your site url by phpbb during installation - I don't know that package, but you may have to take it out of a settings panel somewhere.
Gabe
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Moving a hosted domain to CGI space

Quote from: digital
... to both but am still seeing ~MYDOMAINNAME in the address bar if the URL is entered without a trailing / (I've changed \.plus\.com in one of the posts I read to \.force9\.net as I've got a Force9 account and the address is cshell.force9.net).

The highlighted text should be \.force9\.co\.uk for Force9. The condition would never match as it stands.
David
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: Moving a hosted domain to CGI space

and /folder would be /phpBB3, but I thought it was the ~username that wasn't wanted. A quick google suggests it might be worth checking what is set in
General -> Server configuration -> server settings -> Force server URL settings
General -> Server configuration -> server settings -> domain name
but I'm guessing. If it can't be fixed by rewrite or in settings, then you may need to fix certain rogue variables manually or with a wrapper.
Gabe
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Moving a hosted domain to CGI space

I've done a trial installation of phpBB3 - no problems with installation. I set directory permissions to 710, PHP file permissions to 700 using Gabe's script. Uploading and displaying an image in a post works OK with these permissions.
During installation the automatically determined Script path (under Server settings) was shown as  /~username/phpBB3 - I removed /~username from that to leave /phpBB3. However post installation /~username still appeared on the address line.
When I accessed the Administration Control Panel I noticed Server settings -> Force server URL settings (mentioned by Gabe) was set to "No". The text explains this means the overrides will be ignored. So changed that to "Yes" (with Script path /phpBB3) and saved the changes. That removed /~username from the address line. Smiley
I think I could have set Force server URL settings to "Yes" during installation but wasn't sure whether that was necessary at that time.
I haven't modified the .htaccess file that installs with phpBB3 in directory /phpBB3. I do have a 'missing trailing slash' fix in my root .htaccess and that fixes browsing to http://domain-name/phpBB3 (without the slash) without causing /~username to appear.
David
David
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: Moving a hosted domain to CGI space

Bingo! David goes the extra mile to nail the solution.
Gabe
digital
Grafter
Posts: 94
Registered: ‎11-04-2007

Re: Moving a hosted domain to CGI space

Thanks Gabe, thanks David: much appreciated!
Unfortunately, I'm still getting the ~username in the address bar despite making the control panel changes suggested by David. Clearly, I'm going wrong somewhere: perhaps I've screwed something up as I've made the (multiple) changes.
My .htaccess file in the CGI root folder (I've renamed the 'phpBB3' folder to 'forum') reads:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^ccgi\.USERNAME\.force9\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/~USERNAME/forum/
RewriteRule (.*) /folder/$1
The file was uploaded as an ASCII file and permissions set to 644
The .htaccess file in the 'forum' folder reads:
#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
#<IfModule mod_rewrite.c>
#RewriteEngine on
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#</IfModule>
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
Permissions are set to 644 and the file was uploaded as ASCII.
Further help would be gratefully received, but I'm ready to give up and would understand if that was the feeling all round!
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: Moving a hosted domain to CGI space

If the error only appears when you omit the final slash after forum (www.yourdomain.co.uk/forum versus www.yourdomain.co.uk/forum/), then you can fix the root .htaccess. thus:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
RewriteCond %{HTTP_HOST} ^(www\.)?yourdomain\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/~USERNAME/forum/
RewriteRule (.*) /forum/$1

changing "yourdomain" to your actual domain, but you only need to use the last three lines if you really want your domain to point straight at your forum with no /forum in the url. Otherwise, omit the last three lines.
If that doesn't fix it then presumably there's still a ~username lurking in one of the forum settings.
Gabe
digital
Grafter
Posts: 94
Registered: ‎11-04-2007

Re: Moving a hosted domain to CGI space

Thanks, but it's not worked.
I've tried it with Force server URL settings set to both "Yes" and "No".
Looks like, as you say, there's something lurking elsewhere.
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Moving a hosted domain to CGI space

Is your intention that www.domain.co.uk ; (and domain.co.uk) points to ccgi or just ccgi.domain.co.uk? Gabe's suggestion covers the www. style whereas your original one was ccgi. style.
Apart from relocating "RewriteEngine On" to the beginning of the file where it needs to be my root .htaccess is similar to your original. My domain redirects to a different folder but I don't have a leading / on the last redirect, i.e. I would use
RewriteRule (.*) forum/$1
I'm not sure if that would make a difference - as usual the voodoo of .htaccess coming into play.
The .htaccess in my phpBB3 folder is identical to yours. My .htaccess files have permissions 640 but that shouldn't make a difference.
I take it you have set Script path to /forum (without /~username)?
David
David
digital
Grafter
Posts: 94
Registered: ‎11-04-2007

Re: Moving a hosted domain to CGI space

Thanks for your patience and apologies if I've not been clear: it's new to me and I'm trying to use the correct terms!
The domain is hosted within its own folder, 'domainfolder', at the root of my CGI space and I access it as www.domain.info. The hosting in the CGI space was set up as:
Additional DNS records (Advanced)
Left field Type Pri  Right field
www        cname          ccgi.force9.net.
The forum is within its own folder, 'forum', also at the root of my CGI space, and I'm trying to access it as www.domain.info/forum.
If I use the form www.domain.info/forum I see ~username appear in the address bar.
If I use the form www.domain.info/forum/ I don't see the ~username which is how I want it to be whether the trailing / is entered or not.
I have set Script path to /forum and tried it with Force server URL settings set to both "Yes" and "No" but this has made no difference. It's currently set to "No".
I have also set permissions on the .htaccess files to 640 and this, also, has had no effect.
Sadly, removing the leading / on the last redirect hasn't worked either.