View https_forwarded_proto.php
//for elasticbeanstalk in .ebextensions/.config
option_settings:
- option_name: HTTPS
value: 1
//or in .htaccess
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
View Sentora vhost + Laravel
1. Go to Module Admin.
2. Click Apache Config.
3. Scroll to bottom, look at "Override a Virtual Host Setting" section, select your vhost from dropdowns.
4. In "Custom Entry" field, paste the following code:
`DocumentRoot "/var/sentora/hostdata/[username]/public_html/[domain-alias]/public"`
Replace [username] with your login username, and [domain-alias] with your domain directory friendly name (domain.com => domain_com).
5. "Save Host" and waiting for Sentora Daemon, or from terminal, reload httpd service:
View CC_CakePHP_Validation.php
<?php
$validator
->add("card_number", [
"custom" => [
"rule" => [$this, "cardCheckFunction"],
"message" => "Please enter a valid card number."
]
]
)
View Install SSL Sentora
# Install OpenSSL
apt-get install openssl
# Create a directory for your certificates
mkdir /etc/apache2/ssl/
# Create the certificates
View wordpress_sitemap.php
function sitemap_func($atts)
{
$type = 'post';
if (isset($atts['type']) && $atts['type']) {
$type = $atts['type'];
}
query_posts('posts_per_page=-1&post_type=' . $type);
if (have_posts()) :
ob_start();
View mac_windows_10_wifi_fix.txt
Device Manager -> Network Adaptars -> Properties -> Advance -> Power Output -> 25%.
View vendor_clean_cache.txt
bower cache clean
composer clearcache
npm cache clean .
View fontawesome-query-string-remove.css
/*Temporary Fix for Font Awesome ApplicatonManifest offline Cache */
@font-face {
font-family: 'FontAwesome';
src: url('../fonts/fontawesome-webfont.eot');
src: url('../fonts/fontawesome-webfont.eot') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2') format('woff2'), url('../fonts/fontawesome-webfont.woff') format('woff'), url('../fonts/fontawesome-webfont.ttf') format('truetype'), url('../fonts/fontawesome-webfont.svg') format('svg');
font-weight: normal;
font-style: normal;
}