Welcome Guest, Not a member yet? Register   Sign In
Use another domain for a part of url
#1

[eluser]ahadyekta[/eluser]
I want to make a website by CI that some people have a personal page like this
http://main-domain.com/index.php/sites/s...controller...
and i want to allocate a domain for everyone who has this site_id and visitors work by domains like this:
http://sub-site-domain.com/other-controller...

(just replace http://main-domain.com/index.php/sites/site_id/ to http://sub-site-domain.com/ )
and I want to add domains too server but every domains use the core files and database for loading data .
but use their own domain for internal links .
how can I do that?
how can I add domains to server and whats the configuration?
Can I user session of main-domain in sub-site-domains ?
whats a best solution to have a website like this?

#2

[eluser]TheFuzzy0ne[/eluser]
CodeIgniter is pretty good at guessing the current base URL, so leaving it blank in ./application/config/config.php should work.

The pages themselves could be stored in the database, so your controller would know which page to load by the ID or domain name.
#3

[eluser]ahadyekta[/eluser]
thank you very much,but can I use the session cross domains?
i mean save CI session in main domain and use it when visitors are in other domains?
#4

[eluser]ahadyekta[/eluser]
Ok , thank you very much , but can I use the session cross domains?
i mean save CI session in main domain and use it when visitors are in other domains ?
#5

[eluser]TheFuzzy0ne[/eluser]
Yes and no.

Cookies set by one second-level domain can't be read by another. Can you imagine how unsecure that would be?

Since server's don't have direct access to your hard drive, your browser has to send the right cookies for the domain that's handling the request. So a cookie set by example.com would not be readable by foobar.com.

It is possible to emulate cross-domain cookies, but your apps would need to communicate with one-another (and securely) in order to share cookie data. I've never needed to implement anything like that before, so I'm not really sure how I'd go about carrying out the process.




Theme © iAndrew 2016 - Forum software by © MyBB