I am having a strange issue with Apache, Wordpress, and CodeIgniter. I have a laptop which I use for web dev, and it works fine. However, when I tried to access the sites hosted on the laptop's Apache installation through its IP address, the CSS would not load. When I examined the page source, it listed the path of the CSS file as http://localhost/css/site.css
, even though I was accessing the page remotely.
I am running Wordpress and CodeIgniter on the same server, in different subdirectories. On the CodeIgniter header templates, I use <?php echo base_url('/css/style.css');?>
to access the style, and on Wordpress <?php bloginfo('stylesheet_url'); ?>
. Furthermore, when trying to access the admin panel on Wordpress, I am redirected from http://10.0.0.1/wordpress/wp-admin
to http://localhost/wordpress/wp-admin
, which breaks the admin panel too.
Strangely, this issue does not appear on the pure HTML sites, where I use a relative path for the CSS.
I suspect the problem lies with the WP and CodeIgniter config files, which have the domain of the sites listed as localhost
. Another source of the problem could be the Apache config, but I have no idea where to start looking for it.