1

I am using Apache + Codeigniter to setup an RESTful backend service.

I placed codeigniter's project folder html/ under my Apache's web folder. Then I can access it by http://localhost/html/index.php. I want to remove the folder name in my url, access my web like that http://localhost/index.php.

Could anyone can tell me how to config on Apache side or Codeigniter?

Thanks in advance!

Kevin
  • 711
  • 7
  • 19

1 Answers1

2

In Apache folder, just open filename httpd.conf and put this code at the bottom:

Listen 80
<VirtualHost *:80>
     DocumentRoot "D:/htdocs/html/"
</VirtualHost>

Tell me, if it works.

Nere
  • 4,097
  • 5
  • 31
  • 71
  • I tried, that's works. But found another problem, all images of my web cannot show up. Seems the image's location not works well. Do you have any idea about it? – Kevin Oct 22 '15 at 08:11
  • My fault, the image not show up caused the $config['base_url'] of Codeigniter still have html/ path. All works after remove html/ from my $config['base_url']. – Kevin Oct 22 '15 at 08:46