

# suPHP_ConfigPath /dns/com/olympe-network/pcstar/cgi-bin/
AddDefaultCharset UTF-8
# limit file uploads to 2mb
#LimitRequestBody 2048000
AddType application/x-tar .tgz
AddType application/xhtml+xml  .xhtml .xht
AddType image/svg+xml svg svgz
AddType image/x-icon .ico .cur
AddEncoding x-gzip .svgz
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
AddType text/html shtml html htm pc
DirectoryIndex index.html index.htm index.xhtml index.xml index.cgi index.php index.wml default.htm default.html

FileETag None
Header unset Pragma
Header unset ETag
Header unset Vary
Header set x-frame-options "SAMEORIGIN"
Header set X-XSS-Protection "1; mode=block"

<FilesMatch "\.(bmp|css|ico|html?|js|tiff?|gif|p?jpe?g|png|svgz?|swf|txt|xsd|xsl|xml|gz)$">
# Set Cache-Control header
# append
Header set X-UA-Compatible "IE=edge"
Header set Cache-Control "public, no-transform"
Header set Last-Modified "Fri, 26 May 2006 01:14:04 GMT"
# "Thu, 15 Apr 2020 00:00:00 GMT"
Header set Expires "Tue, 31 Dec 2012 00:00:00 GMT"
# SetEnv nokeepalive
<FilesMatch "^\.ht">
Order allow,deny
Deny from all

</FilesMatch>

</FilesMatch>
<files *.xml.gz>
ForceType "application/xml; charset=UTF-8"
AddEncoding gzip .gz
</files>

<IfModule mod_expires.c> 
# Enable expirations.
ExpiresActive on
ExpiresDefault "now plus 1 days"
ExpiresByType application/xhtml+xml "now plus 10 minutes"
ExpiresByType application/javascript "access plus 1 weeks"
ExpiresByType application/x-javascript "access plus 1 weeks"
ExpiresByType application/x-shockwave-flash "access plus 1 weeks"
ExpiresByType image/gif "access plus 1 years"
ExpiresByType image/jpeg "access plus 1 years"
ExpiresByType image/bmp "access plus 1 years"
ExpiresByType image/png "access plus 1 years"
ExpiresByType image/x-icon "access plus 1 months"
ExpiresByType text/css "now plus 1 weeks"
ExpiresByType text/plain "now plus 1 weeks"
ExpiresByType text/xml "now plus 1 hours"
ExpiresByType text/html "now plus 1 hours"
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
# To redirect all users to access the site WITH the 'www.' prefix,    
# (http://example.com/... will be redirected to http://www.example.com/...)
#RewriteCond %{HTTP_HOST} !^www.pcstar\.org\.ru$ [NC]
#RewriteRule ^(.*)$ http://www.pcstar.org.ru/$1 [R=301,L]
RewriteCond %{http_host} ^pcstars\.tk$ [nc]
RewriteRule ^(.*)$ http://www.pcstars.tk/$1 [R=301,L] 
RewriteCond %{http_host} ^spaces.pcxingxing\.net\.ru$ [nc]
RewriteRule ^(.*)$ http://blog.pcstar.org.ru/ [R=301,L] 
RewriteCond %{http_host} ^pcxingxing\.net\.ru$ [nc]
RewriteRule ^(.*)$ http://www.pcstar.org.ru/$1 [R=301,L] 
#RewriteCond %{http_host} ^pcstar\.org\.ru$ [nc]
#RewriteRule ^(.*)$ http://www.pcstar.org.ru/$1 [R=301,L] 
RewriteCond %{http_host} ^www.pcxingxing\.net\.ru$ [nc]
RewriteRule ^(.*)$ http://www.pcstar.org.ru/$1 [R=301,L] 
RewriteCond %{http_host} ^blog\.pcxingxing\.net\.ru$ [nc]
RewriteRule ^(.*)$ http://blog.pcstar.org.ru/$1 [R=301,L] 
RewriteCond %{http_host} ^pcxingxing\.pp\.ru$ [nc]
RewriteRule ^(.*)$ http://www.pcstar.org.ru/$1 [R=301,L] 
RewriteCond %{http_host} ^www.pcxingxing\.pp\.ru$ [nc]
RewriteRule ^(.*)$ http://www.pcstar.org.ru/$1 [R=301,L] 
RewriteCond %{http_host} ^blog.pcxingxing\.pp\.ru$ [nc]
RewriteRule ^(.*)$ http://blog.pcstar.org.ru/$1 [R=301,L] 
RewriteCond %{http_host} ^www.star-bbs\.org\.ru$ [nc]
RewriteRule ^(.*)$ http://www.pcstar.org.ru/ [R=301,L] 
RewriteCond %{http_host} ^star-bbs\.org\.ru$ [nc]
RewriteRule ^(.*)$ http://www.pcstar.org.ru/ [R=301,L] 
RewriteCond %{http_host} ^pcstars\.com\.ar$ [nc]
RewriteRule ^(.*)$ http://www.pcxingxing.com/$1 [R=301,L] 
RewriteCond %{http_host} ^www.pcstars\.com\.ar$ [nc]
RewriteRule ^(.*)$ http://www.pcxingxing.com/$1 [R=301,L] 
RewriteCond %{http_host} ^blog.pcstars\.com\.ar$ [nc]
RewriteRule ^(.*)$ http://blog.pcxingxing.com/$1 [R=301,L] 
RewriteCond %{http_host} ^pcstar\.net\.ru$ [nc]
RewriteRule ^(.*)$ http://www.pcxingxing.com/$1 [R=301,L] 


RewriteRule ^mobilesitemap.xml mobilesitemap.xml.gz [L]
RewriteRule ^sitemap.xml sitemap.xml.gz [L]
RewriteRule ^sitemap.gz sitemap.xml.gz [L]

RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !(login|register|admin)
RewriteRule ^(.*)$ http://www.pcxingxing.info/main/$1 [R=301,L]

########## Block bad user agents
RewriteBase / 
RewriteCond %{HTTP_USER_AGENT} ^-?$   [NC,OR]
RewriteCond %{REQUEST_URI} (.htaccess|.htpasswda)   [NC,OR]
RewriteCond  %{HTTP_USER_AGENT}  Mozilla/4\.0$  [NC,OR]
RewriteCond  %{HTTP_USER_AGENT}  Mozilla/4\.0\ \(compatible;\)$  [NC,OR]
RewriteCond  %{HTTP_USER_AGENT}  Mozilla/4\.0\ \(compatible;\ MSIE\ 5\.00;\ Windows\ 98\)$  [NC,OR]
#RewriteCond  %{HTTP_USER_AGENT}  Mozilla/4\.0\ \(compatible;\ MSIE\ 6\.0;\ Windows\ NT\ 5\.1;\ SV1\)$  [NC,OR]#
RewriteCond  %{HTTP_USER_AGENT}  Mozilla/4\.0\ \(compatible;\ MSIE\ 6\.0;\ Windows\ NT\ 5\.0;\ \.NET\ CLR\ 3\.5\.20706\)$  [NC,OR]
RewriteCond  %{HTTP_USER_AGENT}  Mozilla/4\.0\ \(compatible;\ MSIE\ 6\.0;\ Windows\ NT\ 5\.2;\ SV1;\ \.NET\ CLR\ 1\.1\.4322\)$  [NC,OR]
RewriteCond  %{HTTP_USER_AGENT}  Mozilla/4\.0\ \(compatible;\ MSIE\ 6\.0;\ Windows\ NT\ 5\.1;\ SV1;\ \.NET\ CLR\ 1\.1\.4322;\ \.NET\ CLR\ 2\.0\.50727\)$  [NC]
#RewriteRule ^.* - [F,L]


RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+).html$ /$1.php [L]


</IfModule>
