0

If a URL will contain a sub domain like http://raddyx.sharemybucket.com./ then I want to execute a controller action for that and the sub domain as its parameter.For Ex for above URL I want execute Users controller and profile action with raddyx as its parameter.

Ex : http://raddyx.sharemybucket.com/ for this I want to execute

http://sharemybucket.com/users/profile/raddyx
Cœur
  • 37,241
  • 25
  • 195
  • 267
pkk
  • 283
  • 4
  • 19
  • I want to show user profile page for this i want to use username as sub domain. – pkk Jun 28 '16 at 07:48
  • 1
    This might best be solved with rewrite rules in your web server config (e.g. .htaccess) instead of through Cake routes. – Greg Schmidt Jun 28 '16 at 15:39
  • Something like - `RewriteRule ^(http://)?([A-Za-z]+).sharemybucket.com/?$ http://sharemybucket.com/users/profile/$2 [L,NC]` – Gaurav Jun 30 '16 at 03:29

0 Answers0