• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automatic config[base_url]

#51
[eluser]Colin Williams[/eluser]
Haha.. Not to mention there are more elegant ways to work locally than subdir-ing the hell out of localhost. VirtualHost, anyone?

#52
[eluser]cahva[/eluser]
I was just pointing out that '/' does not work for every situation. That subdirectory does not work for the same reason that I gave you before, only vice-versa Smile

Colin, tell me more about using vhost on localhost. Do you mean that I create hosts like "myproject", "myproject2" etc. on the local machine and add those to vhosts (so the address would be http://myproject/)?

I know how to setup vhosts but havent done that on localhost before.

Automatic base_url on the wiki page works just fine both localhost and the actual domain so I havent bothered to use anything else but aliases.

#53
[eluser]Colin Williams[/eluser]
cahva, I wouldn't see the practicality of developing a site to live on the root locally then in a sub folder on the remote server.

Here's a typical vhost entry I do:

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

Then I just add an entry to my hosts file (Windows)

Code:
127.0.0.1      local.williamsconcepts.com

#54
[eluser]cahva[/eluser]
Ok, thanks colin. I already turned my aliases to vhosts and all is working well Smile With this config base_url can be just '/' as you said.

#55
[eluser]Blaze Boy[/eluser]
[quote author="paulopmx" date="1194256950"]Wiki Page

http://codeigniter.com/wiki/Automatic_configbase_url/[/quote]
thanks man , i have added this feature to my vunsy kernel, now it can know the base URL automatically

#56
[eluser]diasansley[/eluser]
i am stil having a problem when i click on submit i am redirected to http://localhost/CodeIgniter/form
which is my controller


Thanks

#57
[eluser]Zion.b.y[/eluser]
can the next lines work in a none code igniter framework
$root = "http://".$_SERVER['HTTP_HOST'];
$root .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);

thanks


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.