Skip to content
Advertisement

How to perfectly set up virtual host for codeigniter project?

I am trying to make a virtual host for a codeigniter project. I have done this in httpd-vhosts.conf:

JavaScript

and in application/config/config.php,

JavaScript

and

JavaScript

the browser opens the landing page. but when transiting from any other uri it says object not found. And when i configure httpd-vhosts.conf like this:

JavaScript

It arises problem with assets things, i,e images and some css doesnt loads. How can I solve it?

Advertisement

Answer

I am on windows 10 and I use xampp with virtual host this is way I set up.

Put forward slash at end of base url

JavaScript

First go to

Windows > System32 > drivers > etc > host

You may need to open as administrator to be able to save it

You might see some thing like

JavaScript

Below that create another one for dev.facebook-login.com like example:

JavaScript

Save it

Then go to the

xampp > apache > conf > extra > httpd-vhosts.conf

open it as administrator so you can save it.

No need for the index.php on DocumentRoot

JavaScript

Save it and restart the severs.

I use this for my htaccess

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement