Guest User

Subdomain based on CodeIgniter controller name

a guest
Apr 1st, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. RewriteEngine on
  2. RewriteCond %{HTTP_HOST} ^blog.example.com$
  3. RewriteCond $1 !^(index.php|images|css|js|robots.txt)
  4. RewriteRule ^(.*)$ /index.php/blog/$1 [L]
  5.  
  6. if(preg_match('/^blog/',$_SERVER['HTTP_HOST'])) {
  7. $route['(:any)/(:any)/(:any)/(:any)'] = 'blog/$1/$2/$3/$4';
  8. $route['(:any)/(:any)/(:any)'] = 'blog/$1/$2/$3';
  9. $route['(:any)/(:any)'] = 'blog/$1/$2';
  10. $route['(:any)'] = 'blog/$1';
  11. $route['blog'] = 'blog/index';
  12. }
Advertisement
Add Comment
Please, Sign In to add comment