Force Drupal to merge and compress css - css

I'm working on a Drupal site. When I test in IE8 and IE9 the css don't load on my local server. When the site is deployed everything is fine. I need to be able to test on my local server to fix any issue I might encounter before pushing the site live.
I guess it is because this site is over IE's limit in http requests. Is there a way to force Drupal to optimise the css even in development mode.
When I go to the admin/performance menu, I can't select the optimise css option.

Did you "borrow" this htaccess from another site? Reason I ask is because you said you are not using this htaccess for neither vehicletrackingprices.co.uk or quotes.expertsinmoney.com but strangely enough you have a 301 re-direct for quotes.expertsinmoney.com and an index request for vehicletrackingprices.co.uk. :/
Could they be the cause of your problem? If we're lucky, they are. Am I sure? No. But either way those two items deserve atttention.
On the other hand, I tested your htaccess against your 301 so that I can see if it has a ny errors your server may be fighting with and I did find the following:

Related

Why is the www version of website not working properly?

I'm facing a problem with the following website: https://www.rhythmandstrums.ie/
When I open the "www" version of it: https://www.rhythmandstrums.ie/ I get a bugged website, failing to open stylesheets and possibly other file sources, whereas if I open the website without the "www", everything works as expected: https://rhythmandstrums.ie/
Some considerations:
This website is hosted in a Wordpress Multisite, so it shares the same configuration files as other websites, none of the other websites have this issue. So I was wondering if this could be a problem with redirection, although, again, none of the other websites have this problem and they share the same config files (including server block settings and such, it is in nginx).
I have checked the DNS values and nameservers and everything looks fine (I took base from all the other websites that were set up in the same way, I can post a screenshot if it might be of help).
This error also seems to happen in the Wordpress backend, with the admin dashboard not being able to load parts of plugins, it seems like it is looking where it doesn't exist.
I have replaced instances of the www version of the url in the database, as I do with other websites as well, but that didn't seem to fix the issue.
I have cleared cache a few times (both in the cache plugin and manually in the nginx server - manually deleting the contents of the cache folder), and since this has been going for a long time, I don't know if this is cache related, but any suggestion is highly appreciated. Again, all the configs, included the cache plugin settings are the same for all the other websites in the network, which none are having this issue.
If I inspect the console when I'm accessing both versions of the website, www and non-www it seems like it's trying to pull information from different locations, but I can't figure out why it's doing that.
Guys, I hope this was not confusing, but let me know if you you would like to see screenshots or other info that might be relevant. Thanks so much in advance, I really appreciate it.

First GET request too slow (wordpress)

I am running a VPS with multiple wordpress installations on it. When I access my website, the first request that the browser performs is a GET request that takes about 10 seconds to complete, then the css, js files and so on start to be downloaded as fast as one could expect. That slows down my website a lot.
I am running apache2 and php5 with default configurations, plus the following plugins in use:
Wordpress ZenCache.
php's APC cache.
mod_deflate.
The websites are just landing pages with minimal templates, nothing huge. When pages are cached, the previous time can be improved up to 2 or 3 seconds as much.
I understand that many wrong things could make this happen, but could anyone expert devise a possible starting point to fix?
By the way, I had to set up some aliases and redirections with mod_alias and mod_rewrite, I would like to know if that may cause this behaviuor as well.
After following Andrew's advice, I disabled the default reverse DNS lookups in my virtual hosts configuration file by adding the option
HostnameLookups off
In addition, I disabled the use of symlinks when possible with
<Directory /> Options -FollowSymLinks </Directory>
And disabled the logs as well. Now the problem has been solved and everything works much faster now. It was not directly related to Wordpress since a simple html landing page was also suffering from this latency.

Permalinks randomly break and start getting 404

I'm working on a Wordpress instance with some plugins.
Everything works great after it starts serving 404 code. Seems to be random because everything works fine and in some moment the rewrite rules seems to break and the links stops working.
Sometimes it is happening when I update a content (we are using custom content types with this plugin https://wordpress.org/plugins/custom-content-type-manager/) but sometimes without touch anything (for example a weekend in the middle of the night).
We have been checking all the solutions we found but nothing works. The htaccess has the correct permissions and it is rewriting well the urls.
After debuging Wordpress, the problem seems to be that for some reason, it is reseting the rewrite rules to other than the correct ones (here you can find both dumps, the one when the site serves 404 first, and the second one with the correct rules https://es.forums.wordpress.org/topic/permalinks-error-404?replies=5#post-53705).
Also, we check what was the wp-cron running but we didn't find any plugin that touch the rules (I am not sure if WP doed anything with the rules periodically).
Thanks in advance.
Germán
I'm seeing this with a multisite install. It seems to correspond to codebase changes in WP core.

Magento CSS not updating after copying site to another server

I done things a bit backward developing my new site, don't ask me why! But i built the site on the live server it will be hosted on first and the other day i created a sub-domain to hold a copy of the website so i can use it as a sandbox environment and test new plugins, to get PayPal working etc
I followed this tutorial
So it all worked fine! i have a copy of my site on a subdomain working. I had the infamous admin login redirect to itself issue but i sorted that, the reason it wasnt working was because i had my caches disabled in magento before i copied the site. So i had to enable them again in order to gain access ( If anyone knows why this is please share).
So my problem now is, i am updating the design of my website using the css and images in the skin folder. The problem is i update something in the css and load it onto my server and into the subdomain skins folder but nothing changes on the frontend UNTIL about 15 minutes later and me clearing all caches hundreds of times!! i really don't understand whats happening?
The links to my css/js and image folders are all correct in the head of the website. It's just like a time delay between me changing something in the css and the website updating itself.
Any information would be greatly appreciated.
Kind regards
Tom
Have you also disabled cached on Magento Admin? Perhaps you can try reloading the site on a non-cached based version of browsers (e.g. Incognito Mode in Google Chrome).
Your browser is also caching the external css files which is basically good for saving bandwidth of server and reducing page loading speed. But, for development purpose, you need to avoid css caching. On firefox or IE, you can use CTRL+F5 to reload a webpage without cached css.
If you do not want to use CTRL+F5, you can also add timestamp to your css file as URL parameter.
For example, style.css?<?php echo time();?>
You can also use Apache module to expire the caching.
.htaccess
ExpiresByType text/css "access plus 1 second"
http://httpd.apache.org/docs/2.2/mod/mod_expires.html

Wordpress Development Domain

We are developing Wordpress sites and due to some issues with some plugins once the domain is changed (from dev.domain.com to www.domain.com), we have been using a practice of editing host files in house so that we can develop the site on the www.domain.com domain.
This solution works fine for us in house, however when a client wishes to see their site in development we have to walk them through the editing of their host files to see the development site and then back so they can see their live site.
Does anyone have a better idea or solution. Is there a way to make this work at the Apache level? Maybe a Chrome app? It needs to be super simple and automated (scripted) if possible.
Thanks
You could create an VPN connection to your "house" so that the fake www.domain.com will be avaible for them.
So, the issue is that some plugins think they're on www (or will only behave correctly on www)?
Then quite possibly your best quick bet is a Chrome/Firefox extension, although obviously that does require the client to have them installed.
I'd recommend looking at HostAdmin for Chrome and/or fire-hostadmin for Firefox. These should allow you to amend the hosts without too much hassle or direct editing of protected system files.
It is always worth noting that, depending on the client's computer's security, they may run into potential read-only issues (I believe SpyBot Search & Destroy and similar tools lock the hosts file by default).

Resources