Welcome Guest, Not a member yet? Register   Sign In
routes.php and 3rd level domain

Hi everyone,

i was wondering if there's a way to do this:

by typing -> http://word1.mysite.com
apache would call -> http://www.mysite.com/controller1/method1/word1
thus keeping http://word1.mysite.com in the url

i managed to to so by adding this to my .htaccess file

RewriteCond %{HTTP_HOST}  !^(www.*)
RewriteCond %{HTTP_HOST}  ^(.*).mysite.com
RewriteRule ^(.*)$ /index.php/controller1/method1/%1 [QSA,L]

But i was looking for a way to use routes.php instead.

Any suggestion?

Thanks in advance

Don't quote me here, but I don't think it can be done. To my knowledge, routes only work with URI segments, not with the HTTP Host, but I'm sure you could perhaps extend the router to do what you want.

Wow, that was fast!

Thanks anyway, i just wanted to leave my .htaccess as clean as i could.

Theme © iAndrew 2016 - Forum software by © MyBB