Welcome Guest, Not a member yet? Register   Sign In
Problem with CI multi site setup with virtualhosts
#1

[eluser]Unknown[/eluser]
Hi,

I have setup my CI folders in my local machine as follows;

F:\dev\CodeIgniter_1.7.2
\.metadata
\app1
\app2
\htdocs_app1
\htdocs_app2
\system
\system_ci_1.7.2
\user_guide
index.php
license.txt



Have specified the system and application dir paths in the index.php files in htdocs_... dirs too;
The index.php in \htdocs_app1 has;
Code:
$system_folder = "../system_ci_1.7.2";
    $application_folder = "../app1";

The index.php in \htdocs_app2 has;
Code:
$system_folder = "../system_ci_1.7.2";
    $application_folder = "../app2";

The virtual hosts setup is as follows;

Code:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "F:/dev/CodeIgniter_1.7.2/htdocs_app1"
ServerName mybits.localhost
DirectoryIndex index.php index.html index.htm index.shtml
<Directory "F:/dev/CodeIgniter_1.7.2/htdocs_app1">
    Options Indexes
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "F:/dev/CodeIgniter_1.7.2/htdocs_app2"
ServerName linestolinger.localhost
DirectoryIndex index.php index.html index.htm index.shtml
<Directory "F:/dev/CodeIgniter_1.7.2/htdocs_app2">
    Options Indexes
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

Have entered the host names in the hosts file too.
(127.0.0.1 mybits.localhost
127.0.0.1 linestolinger.localhost)

The problem is only the base url works(like http://mybits.localhost , for which the default controller welcome.php gets called). When I access urls with any controller segment,it doesn't work, throws a 404 error. Even http://mybits.localhost/welcome doesn't work.

Any idea what could be wrong?.
#2

[eluser]Narkboy[/eluser]
Just to clarify:

http://mybits.localhost will give you the welcome page
http://mybits.localhost/welcome does not?

What does:

http://mybits.localhost/index.php/welcome give you?

You've not posted any mod_rewrite directives, nor said if you are using it. If not, then you must include the index.php before your controller / method calls.

/B

Edit - are these sites related? Do they interact in some way? If not, keep them totally seperate. I run about 20 different CI installations on my dev machine using vhosts and everyone is kept apart, as they will be once they go live.




Theme © iAndrew 2016 - Forum software by © MyBB