Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I have a particular problem with the site here. It's a b2b site and it has a word 'advertise' in the domain name. When Drupal loads resources (css/js) it refers to the full url, including that domain name. And those resources are getting blocked by AdBlock on Chrome so as a result site is broken.

Is there a way to refer to css/js locations as local urls (without the host part)?

share|improve this question
    
Drupal doesn't load resources (css/js), the browser does. Even if you provide a relative path for a CSS file, the browser is going to need to use the full address, including domain name, to download the file. Nothing you can do here except host the files on a different domain –  Clive Jul 2 at 9:25
    
Sorry, I meant when Drupal outputs headers with urls to resources. How do you setup Drupal to refer to resources on a different domain? –  belinea Jul 2 at 9:29
    
No my mistake, so are you saying the the ad-block is being invoked because of the URLs in the source of the HTML, not because the browser is physically trying to access those URLs? It's an important distinction to make –  Clive Jul 2 at 9:31
    
In the header, links to resources look like this: "domain.with.advertise.word/themes/some_theme/css/…). AdBlock blocks browser from loading them. I thought the solution may be to set up local links eg: /themes/some_theme/css/style.css. But not sure if this would make difference for AdBlock. But in general trying to find out how to setup the resources links that drupal outputs (either remove host and point locally or enter a different domain) –  belinea Jul 2 at 9:36
    
Good question, Drupal doesn't have an option for that as far as I've seen...I think you're looking for something like this –  Clive Jul 2 at 9:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.