cancel
Showing results for 
Search instead for 
Did you mean: 

2 domains - 2 sites - Wordpress - Subfolders?

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

Re: 2 domains - 2 sites - Wordpress - Subfolders?

Glad to hear you got this working. As intended the website URLs give no indication the files are in a subfolder. Smiley
In my case uploaded media are in the default location so I guess I avoided having to change the path. In fact the path no longer appears in my dashboard settings - I think that came in with WP 3.5.
Hope setting up the second site goes well. Smiley
David
David
oakbydesign
Grafter
Posts: 35
Registered: ‎01-06-2014

Re: 2 domains - 2 sites - Wordpress - Subfolders?

Umm...it hasn't gone well.
Here is my htaccess that is located in /public
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
RewriteCond %{HTTP_HOST} ^(www\.)?oakfireplacebeams\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/ofb/
RewriteRule (.*) /ofb/$1
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
RewriteCond %{HTTP_HOST} ^(www\.)?oakbydesign\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/obd/
RewriteRule (.*) /obd/$1
The second half (oakbydesign - initial website) works!  the first half (the 2nd website) gives an error of 403 forbidden.
My folders look like this
public
        htaccess (as above)
        obd
            htaccess (works ok)
        ofb
            htaccess (see below)
I have changed the 2 urls in the database to http://www.oakfireplacebeams.co.uk using myphpadmin as well.
Sometimes?? i see the new website but it seems that the css is not there and therefore get a text like appearance?
htaccess for ofb is
Redirect 301 /pages/gallery.html http://www.oakfireplacebeams.co.uk/gallery/
Redirect 301 /pages/distributors.html http://www.oakfireplacebeams.co.uk/distributors/
Redirect 301 /pages/corbels.html http://www.oakfireplacebeams.co.uk/fixings/corbels/
Redirect 301 /pages/aftercare.html http://www.oakfireplacebeams.co.uk/
Redirect 301 /pages/style.html http://www.oakfireplacebeams.co.uk/your-beam/shape/
Redirect 301 /pages/colour.html http://www.oakfireplacebeams.co.uk/your-beam/colour/
Redirect 301 /pages/size.html http://www.oakfireplacebeams.co.uk/your-beam/size/
Redirect 301 /pages/extras.html http://www.oakfireplacebeams.co.uk/your-beam/extras/
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ -
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
</IfModule>
# END WordPress
I have better-wp-security plugin installed, I will try and rename/uninstall this if necessary?
Thanks
Richard
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: 2 domains - 2 sites - Wordpress - Subfolders?

Oh dear. Sad
My suspicion is that the /public/ofb folder doesn't exist, or it does but the web server can't open it. If one requests /ofb without a trailing slash the first rule doesn't add one which implies that isn't a directory. Also a 404 Not Found results. (Trying the same with the working domain and /obd does result in a slash being added and a page displayed, though page content is missing because links will be messed up).
Concerning the rules overall. The root .htaccess file adds missing trailing slashes twice which shouldn't upset processing but adds unnecessary complexity I suggest using the following which includes explanatory comments.
Quote from: oakbydesign
RewriteEngine on
RewriteBase /
# Ensure trailing slashes are present on all directory URL requests
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
# Rewrite oakfireplacebeams into its own subfolder
RewriteCond %{HTTP_HOST} ^(www\.)?oakfireplacebeams\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/ofb/
RewriteRule (.*) /ofb/$1
# Rewrite oakbydesign into its own subfolder
RewriteCond %{HTTP_HOST} ^(www\.)?oakbydesign\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/obd/
RewriteRule (.*) /obd/$1

For the subfolder .htaccess the presence of those hard redirects rings alarm bells to me. I'd be seeking to use mod_rewrite directives to achieve this. Are they required because the site had been redesigned but search engines might have old links?
David
David
oakbydesign
Grafter
Posts: 35
Registered: ‎01-06-2014

Re: 2 domains - 2 sites - Wordpress - Subfolders?

Thanks
I have changed the root htaccess file as requested.
The /ofb does exist see attachment
Here is the htaccess within the /ofb folder
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ -
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
</IfModule>
# END WordPress
I have also changed the 2 areas in the wp-options table with myphpadmin  (site url and another) to http://www.oakfireplacebeams.co.uk
I have checked all other settings I can think of, replicating the oakbydesign settings (obviously replacing them with oakfireplacebeams where necessary.
I think it might be a plugin called better-rp-security although I have removed every trace of it for the tables and ftp.
If the htaccess code above looks ok, can you talk be through a 'backup and install' the oak fireplace beams website?
I really need this to be LIVE tonight  Shocked
Many thanks
Richard
PS  If I try to access http://ccgi.digger.plus.com/ofb/wp-admin/
it redirects me to
http://www.oakfireplacebeams.co.uk/wp-login.php?redirect_to=http%3A%2F%2Fccgi.digger.plus.com%2Fofb%...
Could this help you?
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: 2 domains - 2 sites - Wordpress - Subfolders?

I've done a bit of experimentation with a test site of mine and confirmed that rewriting two different domains into subfolders does work. I amended the URL entries for the second site in Dashboard settings to remove /folder from their previous values. However uploaded media URLs in existing blog posts still contain /folder. They work like that, but also if I use the URL without /folder in the browser address field. That implies the (second) domain rewrite works.
So why doesn't yours? Huh
Perhaps it does but there's a problem with your site (code or Hostopia configuration). I think I'd try temporarily renaming the WordPress /ofb/index.php and replace it by a simple page containing (say)

<?php
echo "<h1>Hello there!</h1>";
?>

Then see if that displays OK when referenced as
www.oakfireplacebeams.co.uk
www.oakfireplacebeams.co.uk/ofb ;   and
ccgi.digger.plus.com/ofb

The .htaccess in my WP folder (created by WP itself) is identical to the one you listed - and my site works - so that should be OK.
If I use your account URL with /ofb (no trailing slash) one is added and originally an empty page resulted, but now it looks like I get the intended page but with missing CSS. The page seems built from lots of JavaScript.
Do the same with /obd and the normal header displays with "Page not Found - Click the Logo" content.
I'm sure there must be a clue somewhere amongst all this but …
David
David
oakbydesign
Grafter
Posts: 35
Registered: ‎01-06-2014

Re: 2 domains - 2 sites - Wordpress - Subfolders?

David
Many thanks for your persistence.
Using the new index.php file with "Hello There!"
The results are
www.oakfireplacebeams.co.uk - Forbidden 403 error - You don't have permission to access / on this server.
www.oakfireplacebeams.co.uk/ofb - Not Found 404 error - The requested URL /ofb was not found on this server.
ccgi.digger.plus.com/ofb - It Works!
Then converting it back to the original index.php
The results are the same but, as you said, the ccgi.digger.plus.com/ofb loads the menus etc, without css?
Thanks
Richard
oakbydesign
Grafter
Posts: 35
Registered: ‎01-06-2014

Re: 2 domains - 2 sites - Wordpress - Subfolders?

Also, see attached screenshot for Cpanel.
There was a big mix up back in June and I was given or created  Huh 2 log on names.
ccgi.digger.plus.com AND oakbydesign.co.uk ?Huh
I only use the ccgi.digger.plus.com, however,  when I look in the oakbydesign.co.uk's account, I have a matching database for oakbydesign.  
I have also tried to create the oakfireplacebeam database under both users but nothing.
Thought this might help?
The bandwidth vary a lot.  ccgi.digger.plus.com is as shown.  The other is nearly 4800MB !
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: 2 domains - 2 sites - Wordpress - Subfolders?

I think that points to a configuration problem for www.oakfireplacebeams.co.uk and oakfireplacebeams.co.uk on the Hostopia server.
Time for a chat with Plusnet I think.
David
PS I was just about to post this, though maybe you've identified where the problems are. But I'll post anyway. About to go out now… Roll_eyes
David
oakbydesign
Grafter
Posts: 35
Registered: ‎01-06-2014

Re: 2 domains - 2 sites - Wordpress - Subfolders?

Another Idea  Roll_eyes
As I cannot login to the dashboard, I used myphpadmin and changed the site url and another value in wp-options to ccgi.digger.plus.com/ofb/
It sort of works but the links are still not working.
Try ccgi.digger.plus.com/ofb/
Richard
oakbydesign
Grafter
Posts: 35
Registered: ‎01-06-2014

Re: 2 domains - 2 sites - Wordpress - Subfolders?

Thanks for your help.
Will you keep me updated after speaking to PN?
Regards
Richard
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: 2 domains - 2 sites - Wordpress - Subfolders?

All the links in the page at ccgi.digger.plus.com/ofb/ have their "domain_name/directory" text duplicated, so won't be found. I can't immediately think of what might be causing that.
Sorry but contacting Plusnet will have to be done by you. They won't discuss another user's account with me. I suggest raising a Plusnet Hosting (CGI) ticket at https://www.plus.net/wizard/?p=wizard&page=23097&wizard_id=38 briefly explaining a server configuration problem is suspected with those domains and referencing your reply #20.
It looks like the problems you encountered earlier this year might not have been completely resolved.
David
David
IanSn
Rising Star
Posts: 565
Thanks: 31
Registered: ‎25-09-2011

Re: 2 domains - 2 sites - Wordpress - Subfolders?

@oakbdesign
Please do post back if you get a resolution - I was hoping there would be one. You've got me at it as well here!
oakbydesign
Grafter
Posts: 35
Registered: ‎01-06-2014

Re: 2 domains - 2 sites - Wordpress - Subfolders?

Hi
Ticket sent.
Will keep you updated.
Thanks
Richard
oakbydesign
Grafter
Posts: 35
Registered: ‎01-06-2014

Re: 2 domains - 2 sites - Wordpress - Subfolders?

SORTED !    Cheesy
Apparently, when you change the DNS server to point to hostopia it will propagate after 4 hours or so AND you need to ADD the domain to the Cpanel.  I was unaware of this. 
Nothing was mentioned about having to raise a ticket to PN and then ask them to add the domain name manually.
Very frustrating but sorted.
Thanks for all your help
Richard
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: 2 domains - 2 sites - Wordpress - Subfolders?

Glad to hear the problem has been solved.
The site now displays fine with no indication in the address bar of the underlying physical file paths. Smiley
David
David