I have successfully separate frontend and backend. But I am unable to set this in virtual host. Please check:
Backend virtual host:
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\myproject"
ServerName admin.chinmay.com
<Directory "C:\xampp\htdocs\myproject">
AllowOverride All
Order allow,deny
Allow from all
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . backend.php
DirectoryIndex backend.php
Require all granted
</Directory>
</VirtualHost>
Frontend virtual host:
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\myproject"
ServerName demo.chinmay.com
<Directory "C:\xampp\htdocs\myproject">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
See above code my backend.php file which is not working for inner pages.
admin.chinmay.com this is working fine but when I call other controller action I got index.php instead of backend.php
I want all the action and sub-action which comes under admin.chinmay.com should load backend.php file.
I’m sorry, Chinmay, but I have no experience in creating both backend and frontend on the same DocumentRoot as you are trying to do. Also the wiki you’ve mentioned looks too complex to me. (You know, I’m extremely fond of simpleness and easiness.)
What I can say is that you will be happier if you follow the standard way of doing, that is, constructing backend and frontend on the different DocumentRoots.
And consider using Yii 2.0, if you haven’t written a lot so far using Yii 1.1. Yii 2.0 is much sweeter.