cancel
Showing results for 
Search instead for 
Did you mean: 

Moving a hosted domain to CGI space

spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Moving a hosted domain to CGI space

Sorry, I'd forgotten where this thread started. Roll_eyes
I've changed my root .htaccess to the following, and it works as you desire on my webspace. My root .htaccess file is now:
RewriteEngine On
RewriteBase /
# Fix trailing slash problem
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
# Point domain to /phpBB3 folder
RewriteCond %{HTTP_HOST} ^ccgi\.domain\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/~username/phpBB3/
RewriteRule (.*) phpBB3/$1

I use the hostname ccgi.domain.co.uk because www.domain.co.uk still points to homepages.
In the forum Administration Control Panel Force server URL settings is set to "Yes" and Script path is set to /phpBB3
Now if I browse to ccgi.domain.co.uk the address stays at that but the forum login page shows. If I add a / to that, the slash is removed and I end up in the same place. Browsing round the forum works but /phpBB3 never shows in the address bar. Example;
http://ccgi.domain.co.uk/viewtopic.php?f=2&t=1&sid=.....#p3

If I enter the address ccgi.domain.co.uk/phpBB3 without a slash the slash is added and again the forum login page shows. Browsing to the same place in the forum retains /phpBB3 in the address bar, like:
http://ccgi.domain.co.uk/phpBB3/viewtopic.php?f=2&t=1&sid=.....#p3

However /~username never appears, so it is possible to achieve that. Does your set-up effectively match this?
David
David
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Moving a hosted domain to CGI space

Diverting a little to the side of the ongoing discussion and thinking about the behaviour when I used the ccgi.domain.co.uk address.
It puzzled me why this did not switch to the ccgi.username.force9.co.uk/phpBB3 style when the forum was entered, since that is set in the ACP by the Domain name and Script path combination. Previously I'd navigated the initial board without logging on. After I'd logged on the address bar did switch to that expected. So it seems different behaviour is experienced by not logged on (guest) and logged on users. This must mean different PHP code is traversed.
I've now changed the Domain name setting in the ACP to ccgi.domain.co.uk and Script path to /. With the rewrite rule I have in the root .htaccess the address bar doesn't show the folder name /phpBB3 but everything works - and the behaviour for guests and logged in users is consistent.
Just wondering if this diversion gives a clue to where your /~username comes from. Have you been logged into the forum when /~username appears.
David
David
digital
Grafter
Posts: 94
Registered: ‎11-04-2007

Re: Moving a hosted domain to CGI space

Quote from: spraxyt
Sorry, I'd forgotten where this thread started. Roll_eyes
I've changed my root .htaccess to the following, and it works as you desire on my webspace. My root .htaccess file is now:
RewriteEngine On
RewriteBase /
# Fix trailing slash problem
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
# Point domain to /phpBB3 folder
RewriteCond %{HTTP_HOST} ^ccgi\.domain\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/~username/phpBB3/
RewriteRule (.*) phpBB3/$1

I use the hostname ccgi.domain.co.uk because www.domain.co.uk still points to homepages.
In the forum Administration Control Panel Force server URL settings is set to "Yes" and Script path is set to /phpBB3
Now if I browse to ccgi.domain.co.uk the address stays at that but the forum login page shows. If I add a / to that, the slash is removed and I end up in the same place. Browsing round the forum works but /phpBB3 never shows in the address bar. Example;
http://ccgi.domain.co.uk/viewtopic.php?f=2&t=1&sid=.....#p3

If I enter the address ccgi.domain.co.uk/phpBB3 without a slash the slash is added and again the forum login page shows. Browsing to the same place in the forum retains /phpBB3 in the address bar, like:
http://ccgi.domain.co.uk/phpBB3/viewtopic.php?f=2&t=1&sid=.....#p3

However /~username never appears, so it is possible to achieve that. Does your set-up effectively match this?
David

Thanks for all the investigating you've done!
www.domain.info points to the CGI server, not homepages, but see my next post...
digital
Grafter
Posts: 94
Registered: ‎11-04-2007

Re: Moving a hosted domain to CGI space

Quote from: spraxyt
I've now changed the Domain name setting in the ACP to ccgi.domain.co.uk and Script path to /. With the rewrite rule I have in the root .htaccess the address bar doesn't show the folder name /phpBB3 but everything works - and the behaviour for guests and logged in users is consistent.
Just wondering if this diversion gives a clue to where your /~username comes from. Have you been logged into the forum when /~username appears.
David

I've deleted and rebuilt the forum and set up the ACP as you suggest above with .htaccess containing only the fix trailing slash lines in it and I've lost the ~domainname! Thank you!
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Moving a hosted domain to CGI space

Excellent news. Smiley
Thanks for the feedback.
David
David
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Moving a hosted domain to CGI space

See also topic "My new phpBB forum ---- myusername appears in browser address bar --- eeeek !" for more on the ~username and phpBB3 saga.
David
David