I'm using .htaccess to rewrite urls and I used html base tag in order to make it work.
Now, when I try to make an ajax request I get the following error:
XMLHttpRequest cannot load
http://www.example.com/login.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://example.com' is therefore not allowed access.