Welcome Guest, Not a member yet? Register   Sign In
CI install on apache alias
#1

[eluser]esskay[/eluser]
Hi,

Has anyone installed a CI app on an apache alias ..
I had problem doing this ... it would say page not found

I worked around with sym links.
Was just wondering if anyone has faced a similar issue.

~Ess
#2

[eluser]cahva[/eluser]
On WAMP I used aliases before I started to use vhosts.

For example this is one of my aliases:
Code:
Alias /somesite "c:/web/somesite/public_html/"

<Directory "c:/web/somesite/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order allow,deny
    Allow from all
</Directory>

That would point to http://localhost/somesite/

Nowdays I create virtual host as that way its more the same as on the production server. Using that same example I would have vhost like this:
Code:
NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot C:/web/somesite/public_html
    ServerName local.somesite.com
    
    <Directory "C:/web/somesite">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

I see youre not using windows but its the same(just change your paths to *NIX ones). Ofcourse the local.somesite.com address has to be added to hosts file and point to localhost ip 127.0.0.1.

Oh.. and if you have added the alias correctly, did you remember to restart the server? Smile
#3

[eluser]esskay[/eluser]
Thanks for the Reply Cahva,

I have used virtualhost and alias extensively and successfully Smile

Can you once try creating an alias on the virtualhost you use and see if that works ??

Actually I wanted to setup a test installation at the alias of the domain just to keep things clean.

Eg : www.xyz.com - production
www.xyz.com/test - alias
#4

[eluser]cahva[/eluser]
If I were you, I would forget the alias and create vhost for the test and www for each. For example test.xyz.com and www.xyz.com. That way its cleaner. I mean, if you use .htaccess, you would have to have different rewrite settings in it(one that comes to my mind is you have to add RewriteBase to your test folder). Also define $config['base_url'] according to the test folder unless you are using automatic base_url found in the wiki.

My own workflow is that I have 3 addresses for a project:
- localhost (local.xyz.com) - for the development
- test.xyz.com - place where I checkout files from my local server that client can test
- final www.xyz.com - Just sync test.xyz.com files here when project is ready

In all 3 places, the configuration and .htaccess file are the same:

app/config/config.php
Code:
$config['base_url'] = '/';

pubic_html/.htaccess
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

As you can see, theres no need to set base_url any differently or use hacky automatic base_url thingies. Just wash'n go Wink




Theme © iAndrew 2016 - Forum software by © MyBB