1

Following a change to .htaccess in public_html to attempt HTTP->HTTPS redirection CSS began failing for my site. Reverting the file didn't help so I chose to press forward with changing all instances of http://domain -> https://domain using recommended methods online. However, my CSS still isn't loading... (attempted clearing local and wordpress cache already).

Upon developer inspection from a browser I find the following errors: ERR_TOO_MANY_REDIRECTS Indicating to me that the CSS files aren't being loaded. Inspecting these indicates the CSS file isn't brought to the local machine, and copying the link I'm unable to retrieve the file... however - if I remove the ?ver=x.x.x statement lets me load it independently.

I attempted to modify the functions.php file to do try and push null to the version hoping that would remove it, but it didn't seem to change anything even after more cache clears. enqueue_style=null Without changes my enqueue_style looked like: enqueue_style default

What should I do? Is there a way I can remove the versioning info from the request itself? I believe these files are still being requested using HTTP, but a plugin named "Find and Replace" is currently rerouting them to https... how can I update these to directly request https?

5
  • You didn't set up HSTS on your domain did you? That might be interfering with this still. – Rup Jun 5 at 15:01
  • All of this content is fetched based on either the Site URL and Blog URL in your WordPress settings under General. Can you make sure they both have HTTPS? If you can't get into the admin site to change them there are other ways documented here. – Rup Jun 5 at 15:02
  • And even then I'd guess you have a bug in your Apache config. I don't think you can solve this with PHP changes. – Rup Jun 5 at 15:03
  • 1
    (Oh, missed that you'd already posted an answer - I'm viewing this in a review queue. I still don't think the versions are themselves to blame, but glad you got this fixed.) – Rup Jun 5 at 15:04
  • That happens to me a lot @Rup and then I feel like a buffoon for echoing what someone else said in an answer. :face palm: – Tony Djukic Jun 6 at 18:06
0

For anyone else who may stumble upon this post in the future...

I used the same plugin, "Find and Replace" and searched for the following regex globally: "\?ver=\d\.\d(\.\d)?" and replaced with nothing. This had the desired effect and after a short while the site returned to normal.

Find and Replace regex

Not the answer you're looking for? Browse other questions tagged or ask your own question.