1 jinkazama82it Jul 12, 2017 13:59
3 mgsolipa Jul 14, 2017 01:17
@jinkazama82it I think that your new $baseurl
value doesn't solve the 404 error when visiting http://other.com/thirdcollection
. Am I right?
In order to make it work, you may do the following:
(I haven't seen this technique used in a b2evolution site before, but it may do the trick since it's a common solution recommended and applied by other platforms on production sites)
- Create a folder
thirdcollection
at the root of your site. - Create a stub file
index.php
pointing to the collection inside the new folder (more info here: http://b2evolution.net/man/stub-file). - (this is the tricky part) Create symbolic links inside the new folder to the following root folders: htsrv, media, plugins, rsc and skins. The most common way to do this in *nix systems is through the following command:
ln -s ../htsrv htsrv
. If you have no chance to create the links by your own in your online server, you should ask customer support to do it for you. - Copy the default .htaccess file into the new folder.
- Configure the URL section of the new collection as displayed in the screenshot below.
I would like to stress this out: such a technique like this is perfectly valid, and in a quick few tests I did it seems to work, but you should make many more test before to use it on a production site. Please let us know how it goes.
Regards!
4 jinkazama82it Jul 14, 2017 07:28
At the moment I haven't problem, I have into my local sever main.com and other.com and all work well for the second or other collection in other.com some shrewdness need to applied for other.com is to change the cookie value from .other.com
to other.com
and any new collection that need to be opened under other.com need to set the Collection url like extra path on baseurl.
only one thing I need to hack at the moment and is the short name for the link that return at the current domain, with my hack now it return at the correct domain main.com or other.com) but have the same short name of main.com (it is a parameter put in during installation) but probably I need more time for that (I need to investigate more into the code for find a clean and easy solution)
Ok, I know that a double post isn't good, but I've solved the "issue" (into "" because for me are an issue, for you I don't know) mentioned in this thread and at the same time partially solved the issue mentioned into the thread http://forums.b2evolution.net/link-to-main-collection-and-about-page-related
now i can see the secondary domain in every collection and at the same time i can see the main domain in every collection witouth make strange redirection or modification at server level, the collection saved with the secondary domain are opened when i put into the browser the secondary domain and at the same time is visible with the correct url into main site, when I log-in like administator no strange redirection or issue with back-office (yes I can edit everithing into back-office from secondary domain).
All of this on my local wamp server, i don't have a real runnable server for test it, cam be usefull if someone can test it on various server type (like shared host with cPanel for example or similar)
How I made it possible, I searched a lot into configuration file for handle the best and easy practice to apply and I found it!!
I have simply added this line of code
$baseurl = 'http://'.$_SERVER['HTTP_HOST'].'/';
after the original that have static link at the main domain (I mantained the original for precaution but probably is unnecessary)Unique aspect that at the moment i can't change is the about page, because if "contact" and "login" from option can be changed to "current collection" the about page don't have that option so, is a little frustrating but respect to the above hack add a new option to the about configuration is out of my capacity because I don't know where is located the code for it, how is loaded the about page and how replicate and make it unique for every alternative domain.
Just a note for the "contacts" and "login" pages is required the version 6.8.9 of b2e otherwise they will retun an error.