Welcome Guest, Not a member yet? Register   Sign In
put checks in routes file ?
#1

[eluser]Zeeshan Rasool[/eluser]
hi every one, can any one tell me that how can we put checks in routes file to control both site and admin as well?
I am using one route file but if there is a check for site it can effect to admin so i have to write a separate rewrite condition for admin in against of each rewrite condition of site.
So i need a check so that its easy to determine conditions for both side separately

very thanks!
#2

[eluser]Phil Sturgeon[/eluser]
You want different routes in the same file, based on which site it is?

routes.php

Code:
if($_SERVER['HTTP_HOST'] == 'foo.com')
{
   // routes
}else == 'bar.com')
{
   // routes
}

or use a switch, you get the idea though.
#3

[eluser]Zeeshan Rasool[/eluser]
yeah thanks, Phil it really nice idea.
i was thinking that may be there would be some other solution Smile but its good
#4

[eluser]Phil Sturgeon[/eluser]
You can do it there or in the .htaccess which is probably a better solution. You said "routes" so I went with it.
#5

[eluser]Zeeshan Rasool[/eluser]
no no its ok, very thanks for this ;-)




Theme © iAndrew 2016 - Forum software by © MyBB