VirtualHost for www and http - CodeIgniter

Problems with the Windows version of XAMPP, questions, comments, and anything related.

VirtualHost for www and http - CodeIgniter

Postby ifriend » 11. November 2014 16:17

Hey guys,

My website is working when it's typed http://mywebsite.com, but it's not working when typed www.mywebsite.com, because it retrieves me an error:
Code: Select all
Font from origin 'http://mywebsite.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.mywebsite.com' is therefore not allowed access.

My VirtualHost configuration is the following:
Code: Select all
<VirtualHost *:80>
   ServerName mywebsite.com
   documentRoot "C:/xampp/htdocs/mywebsite"
</VirtualHost>

I can put the "www" working, but that would mean that "http://" won't work anymore.
I'm wondering if this is a Xampp problem or a PHP problem? In my configuration file of CodeIgniter I have:
Code: Select all
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|   http://example.com/
|
| If this is not set then CodeIgniter will guess the protocol, domain and
| path to your installation.
|
*/
$config['base_url']   = 'http://mywebsite.com/';


Thank you.
ifriend
 
Posts: 1
Joined: 11. November 2014 16:13
Operating System: Windows 7

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 139 guests