• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

http

Yum Cache Corruption

February 4, 2022

If you’re getting a “HTTP Error 404 – Not Found” error when trying to run yum update, it could be a corrupted cache. Clear the cache on the system by running the following.

yum clean all
rm -rf /var/cache/yum/*

yum clean all rm -rf /var/cache/yum/*

Run yum update again. The errors should be gone.

Filed Under: Linux Tagged With: 404, cache, clear, corrupted, error, http, update, yum

Force Rewrite To HTTPS Except For Page

October 31, 2018

Here’s how to force a rewrite pages to https except for a couple of pages.

RewriteEngine On
 
RewriteCond %{HTTPS} =off
RewriteCond %{REQUEST_URI} !^\/page1\/
RewriteCond %{REQUEST_URI} !^\/page2\/
RewriteRule (.*) https://%{HTTP_HOST}/$1 [L,R=301]    
 
RewriteCond %{HTTPS} =on
RewriteCond %{REQUEST_URI} \/page1\/ [OR]
RewriteCond %{REQUEST_URI} \/page2\/
RewriteRule (.*) http://%{HTTP_HOST}/$1 [L,R=301]

RewriteEngine On RewriteCond %{HTTPS} =off RewriteCond %{REQUEST_URI} !^\/page1\/ RewriteCond %{REQUEST_URI} !^\/page2\/ RewriteRule (.*) https://%{HTTP_HOST}/$1 [L,R=301] RewriteCond %{HTTPS} =on RewriteCond %{REQUEST_URI} \/page1\/ [OR] RewriteCond %{REQUEST_URI} \/page2\/ RewriteRule (.*) http://%{HTTP_HOST}/$1 [L,R=301]

The first rule-set will redirect all pages not /page1/ or /page2/ to the same URL but https://.
The second rule will make sure that /page1/ and /page2/ are redirected back to http:// if accessed via https://.

Here’s the Stackdriver source.

Filed Under: Linux Tagged With: force https, http

  • Home
  • About
  • Archives

Copyright © 2023