This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_URI} ^\/$ | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ | |
RewriteRule ^(.*)$ http://%1/$1 [L,R=301] | |
RewriteCond %{REQUEST_URI} !\? | |
RewriteCond %{REQUEST_URI} !\& | |
RewriteCond %{REQUEST_URI} !\= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = mb_strtolower(urldecode($_SERVER['REQUEST_URI']), 'UTF-8') ; | |
if(urldecode($_SERVER['REQUEST_URI']) != $url) { | |
header('Location: http://'.$_SERVER['HTTP_HOST'].$url, true, 301) ; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AuthType Basic | |
AuthName "My Protected Area" | |
AuthUserFile /home/h58768/data/www/ogn.pub-portfolio.pp.ua/.htpasswd | |
Require valid-user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_expires.c> | |
<FilesMatch \.(gif|png|jpg|jpeg|ogg|mp4|mkv|flv|swf|wmv|asf|asx|wma|wax|wmx|wm)$> | |
ExpiresDefault "access plus 1 year" | |
</FilesMatch> | |
ExpiresActive on | |
ExpiresByType image/jpeg "access plus 7 day" | |
ExpiresByType image/gif "access plus 7 day" | |
ExpiresByType image/png "access plus 7 day" | |
<FilesMatch \.(css|js)$> | |
ExpiresDefault "access plus 1 year" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//truncate text | |
function truncate_text($string, $lenght) { | |
if( strlen( $string ) >= $lenght ) { | |
$string = strip_tags($string); | |
$string = substr($string, 0, $lenght); | |
$string = rtrim($string, "!,.-"); | |
$string = substr($string, 0, strrpos($string, ' ')); | |
$string = $string."… "; | |
} |