Welcome Guest, Not a member yet? Register   Sign In
Code Igniter with Real and False Subdomains
#1

[eluser]bparker[/eluser]
Hi,

I am trying to work out exactly how to use mod_rewrite to cope with the usual index.php problem with codeigniter, but also to handle subdomain. Some of these subdomains exist, while others should map to a controller function parameter. For example:

Code:
example.com  -->  www.example.com/index.php/controller/index
www.example.com  -->  www.example.com/index.php/controller/index
management.example.com  -->  management.example.com/index.php
subdomain.example.com  -->  www.example.com/index.php/controller/index/subdomain
www.example.com/media/img.jpg  -->  www.example.com/media/img.jpg
subdomain.example.com/media/img.jpg  -->  www.example.com/media/img.jpg

-the subdomain management.example.com actually exists, so allow it to pass through unchanged. (other subdomains may be added in the future)

-all other subdomains do not exist and should be mapped to a controller/function parameter

-certain subfolders (in this example the media folder holds all extra files, images, css and js for example) do not need the index.php inserting.

-if at all possible, I would like the user to still see the pretty subdomain based web address. I would prefer to keep thge inner workings away from the end users.

-I am happy to accept that either the default controller be used, or have to specify one within the .htaccess file.

i've done alot of reading, testing and getting VERY confused!

Is there anyone who can help me out with this? the idea is to allow people to register with the site and create content (a blog for example). This should then be publicly accessable as the users chosen name being the subdomain.

I've seen this done by many sites but just can't seem to work out a method of doing it!!!

Thanks in advance to any advice anyone has...




Theme © iAndrew 2016 - Forum software by © MyBB