Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In my opinion, what you're trying to do is a bit silly, but, I guess it's not my place to say.</p> <p>Here are your options as far as I see it:</p> <p><strong>Modify your apache config or .htaccess file to redirect calls to a specific subdomain to a specific controller using mod_rewrite:</strong></p> <p>For instance (I haven't tested this):</p> <pre><code>RewriteEngine on RewriteCond %{HTTP_HOST} ^blog.example.com$ RewriteCond $1 !^(index\.php|images|css|js|robots\.txt) RewriteRule ^(.*)$ /index.php/blog/$1 [L] </code></pre> <p>That should at least point you in the right direction, I think. Of course, this assumes that your subdomain is pointed to the same IP address and the apache virtual hosts are setup to point that subdomain to the same directory as your normal domain.</p> <p>You'll also need to point all your links to the subdomain and omit the controller. So, if the URL would normally be: <a href="http://www.example.com/blog/cat/awesome">http://www.example.com/blog/cat/awesome</a> then you'll need to make the link point to <a href="http://cart.example.com/cat/awesome">http://cart.example.com/cat/awesome</a> . So, you're not going to be able to use the nice helper functions like <code>site_url('cart/cat/awesome')</code> anymore--that would be a major turn off for me.</p> <p>I hope that makes sense.</p> <p><strong>Setup your CI instance to support multiple apps and just have the subdomain point to the appropriate app directory</strong></p> <p>For more information: <a href="http://codeigniter.com/wiki/Multiple_Applications/">http://codeigniter.com/wiki/Multiple_Applications/</a></p> <p><strong>Do some crazy stuff with the Route class:</strong></p> <p>In your routes.php config file:</p> <pre><code>if(preg_match('/^blog/',$_SERVER['HTTP_HOST'])) { $route['(:any)/(:any)/(:any)/(:any)'] = 'blog/$1/$2/$3/$4'; $route['(:any)/(:any)/(:any)'] = 'blog/$1/$2/$3'; $route['(:any)/(:any)'] = 'blog/$1/$2'; $route['(:any)'] = 'blog/$1'; $route['blog'] = 'blog/index'; } </code></pre> <p>If any of your pages require more than 4 URI parts, just add another line at the top of the route rules. I don't even know if this would work, per se... but it might. I'd definitely give it a shot as it would be the least amount of work more than likely.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload