"www" prefix doesnt render javascript or images on drupal virtual host

6 posts / 0 new
Last post
#1 Fri, 08/08/2014 - 05:43
laurencefass

"www" prefix doesnt render javascript or images on drupal virtual host

hi i have recently installed virtualmin and am using it to host a drupal site on a virtual host. mysite.com works ok and renders full site, but www.mysite.com delivers a text only version. looks like permissions but im not saying that with confidence... any insight or suggestions will be most welcome... thanks.

Fri, 08/08/2014 - 08:50
lostandfound

Loads of different possible scenarios could cause this. Firstly, most sites will only want one domain with other redirected to it. If you are using Apache then you will want to edit your .htaccess to configure the site. Looki for the section starting

# If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:

Using a tool like mozila firebub or (my preference) chrome dev tools, open the page and inspect the errors. You will notice your CSS/ JS / Images missing and there will be a response code. You can use the response code to save you time in figuring out the problem. "File not found?" "You do not have permission" etc?

If it is file not found, check the paths of the files. If it is permission, check the permissions.

Should be a quick fix.

Mon, 08/11/2014 - 03:34 (Reply to #2)
laurencefass

hi any update on this as I said I didnt make any modifications to default settings... the automatic dns settings just dont work...

Fri, 08/08/2014 - 11:37
laurencefass

thanks for reply. i am not using any custom settings only the automatic settings using out of the box templates. i can see there is a www prefix created in BIND for each new virtual host created. i didnt create it - its just a variation... so both addresses are pointing to same vhost... are you able to try this yourself?

Mon, 08/11/2014 - 04:29
lostandfound

I am not an expert at all but would suggest you try to understand why the assets are not being displayed.

To clarify your issue, example.com is 100% working while www.example.com is missing all css & images. Correct?

I would use Chrome(https://developer.chrome.com/devtools#access) to inspect the broken site and see if the assets are "not found" or if there are access permissions.

Once you know what the problem is you can work towards fixing it.

Mon, 08/11/2014 - 06:20
laurencefass

problem was due to permissions in active browser extension. simple fix. thank you for your help.

Topic locked