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

[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?

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.

[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:

<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

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

Code:      local.williamsconcepts.com

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.

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

thanks man , i have added this feature to my vunsy kernel, now it can know the base URL automatically

i am stil having a problem when i click on submit i am redirected to http://localhost/CodeIgniter/form
which is my controller


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']);


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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