andruxin2013-11-26 11:18:51
andruxin, 2013-11-26 11:18:51

2 applications, 2 domains. What to write in htaccess?

There will be two applications host/www/site1 and host/www/site2.
Yii will be in host/www/framework
In vhost.conf, both domains (site1.ru, site2.ru) will refer to host/www.
It is worth noting that sites are not bulky, and the number of controllers ranges from 5 to 8 and they are different ( site1/action1, site1/action2, ... site2/action10, site2/action11). Therefore, without hesitation, I plan to scatter it in htaccess over applications like this.
Code: Select all

RewriteRule ^action1$             /site1/index.php?r=action1[L]
RewriteRule ^action2$            /site1/index.php?r=action2[L]
RewriteRule ^action10$            /site2/index.php?r=action10[L]
RewriteRule ^action11$            /site2/index.php?r=action11[L] 

am I being overwhelmed and it's easier to write different paths in vhost.conf?
Which method is preferable and what possible pitfalls can be expected?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Vit, 2013-11-26

Better different paths in vhosts. It is simpler, more transparent, and therefore better. No need to suffer when adding new controllers / actions and make sure htaccess is correct. Well, plus a lot of rules in htaccess negatively affect performance.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question