Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter with Multiple Sites
#1

Hello is anyone help me for multiple website in CI, using 1 CI installation, domain and sub-domains with same db.
Reply
#2

Didn't you find the answer here?
http://www.codeigniter.com/userguide3/ge..._apps.html
Reply
#3

yes i read this article this article says like this create main domain and other sub-domains structure

applications/foo/
applications/foo/config/
applications/foo/controllers/
applications/foo/libraries/
applications/foo/models/
applications/foo/views/
applications/bar/
applications/bar/config/
applications/bar/controllers/
applications/bar/libraries/
applications/bar/models/
applications/bar/views/


but index.php file calls only one folder like

$application_folder = 'applications/foo';

when i use sub-domain of "bar" folder then how to use this one
http://bar.domainname.com

this index.php file error because in this "bar" calls "foo" ??

please help me here
Reply
#4

I found a explained 3 approaches to get it done. https://philsturgeon.uk/codeigniter/2009...deIgniter/
Reply
#5

yes i got it its to easy to understand and my subdomains are working with different files.
thanks for help.

kind regards gurpreet
Reply
#6

welcome
Reply
#7

sir
i have changed in the application folder like

application/foo/
application/foo/config/
application/foo/controllers/
application/foo/libraries/
application/foo/models/
application/foo/views/
application/bar/
application/bar/config/
application/bar/controllers/
application/bar/libraries/
application/bar/models/
application/bar/views/



index.php
$application_folder = "applications/foo";
bar/index.php
$application_folder = "applications/bar";

I'm using the "foo" and "bar" as sub-domains

so my url are looking as
http://foo.domain.com/
http://bar.domain.com/


when i used main index.php to change "$application_folder = 'application/foo';"

then it also calls bar folder, but if i removed this "$application_folder = 'application/foo';" then gives an error.
and it also not calls bar/index.php file.
bar/index.php
$application_folder = "applications/bar";

here I'm confused how to open bar folder files because bar/index.php not working


and I'm using the CI version 3.1.0
Reply
#8

Have you configure the DNS zone for your sub-domain ?
You need to make foo and bar sub-domain in your dns
foo would point to your main domain root folder
bar would be a sub-domain in a folder under your root like "public_html/bar"

You don't really need foo as a sub-domain since the index for that application is in your main domain
http://www.domain.com/ will open the foo application as it is set in the index file.
A good decision is based on knowledge and not on numbers. - Plato

Reply
#9

(This post was last modified: 10-12-2016, 06:19 AM by demonicinn.)

I'm creating the new sub-domain "public_html/subdomains/accounts"

and open this "http://accounts.domain.com/"
I'm also copy the index.php file and changed

subdomains/accounts/index.php
$application_folder = "subdomains/accounts";

also insert the files
subdomains/accounts/
subdomains/accounts/config/
subdomains/accounts/controllers/
subdomains/accounts/libraries/
subdomains/accounts/models/
subdomains/accounts/views/

but it gives an error


Forbidden

You don't have permission to access / on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Reply
#10

What do you get if you use: http://accounts.domain.com/index.php ?
if this works it is because you need to copy the .htaccess file in the sub-folder with your index file.
A good decision is based on knowledge and not on numbers. - Plato

Reply




Theme © iAndrew 2016 - Forum software by © MyBB