cs1996/PeerDisk/master/.htaccess - Htaccess File

cs1996/PeerDisk/master/.htaccess

#
# compress text,html,javascript,css,xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/rss+xml
<filesMatch ".css$">
#Header set Content-Encoding x-deflate
# Header set Content-Encoding compress
 Header set Content-Encoding x-gzip
</filesMatch>
#SetOutputFilter DEFLATE

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 second"

ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType image/gif "access plus 3 month"
ExpiresByType image/png "access plus 3 month"
ExpiresByType text/css "access plus 2 month"
ExpiresByType application/javascript "access plus 3 month"
Header set Cache-Control "public"
</IfModule>
FileETag INode MTime Size
ErrorDocument 403 /script/php/error/403.php
ErrorDocument 404 /script/php/error/404.php

DirectoryIndex 'login.php','home.php'

#AddCharset
AddDefaultCharset utf-8

Options +FollowSymlinks
options -indexes

RewriteEngine on
# Unless directory, remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ /$1 [R=301,L]

# Redirect external .php requests to extensionless url
RewriteCond %{THE_REQUEST} ^(.+).php([#?][^ ]*)? HTTP/
RewriteRule ^([^.]+)$.php$ /$1 [R=301,L]

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

#profile page
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [L]
RewriteCond %{QUERY_STRING} !^u= [NC]
RewriteRule ^([a-z0-9-.]+)$ profile.php?u=$1 [L,NC,QSA]

#prevent hot linkimg
RewriteCond %{HTTP_REFERER} !^$
#RewriteCond %{HTTP_REFERER} !^http://(www.)?corz.org/ [NC]
RewriteCond %{HTTP_REFERER} !^http://peerdisk.tk/ [NC]
RewriteCond %{REQUEST_URI} !hotlink.(gif|png) [NC]
RewriteRule .*.(gif|jpg|png)$ /site/img/cubebeans.png [NC]

<IfModule mod_php5.c>
php_value post_max_size 5M
php_value upload_max_filesize 5M
php_value memory_limit 300M
php_value max_execution_time 259200
php_value max_input_time 259200
php_value session.gc_maxlifetime 1200
</IfModule>
 php_value display_errors 0
php_value error_reporting 30719

#php_flag display_errors off

#commented out

<IfModule mod_headers.c>
    #Header set Access-Control-Allow-Origin: http://localhost
   #Header set Access-Control-Allow-Origin: http://peerdisk.tk
  </IfModule>

#Content-Type: text/html; charset=UTF-8
#Access-Control-Allow-Origin: http://peerdisk.tk

#RewriteEngine on
#RewriteCond %{REQUEST_FILENAME}.php -f 
#RewriteRule ^users/(d+)*$ profile.php?id=$1
#RewriteRule ^([^.]+)$ $1.php [NC]
#RewriteCond %{SCRIPT_FILENAME} !-d
#RewriteCond %{SCRIPT_FILENAME} !-f
#RewriteRule ^.*$ ./index.php
#RewriteCond %{REQUEST_FILENAME} >""
#RewriteRule ^([^.]+)$ profile.php?user=$1 [L]

#RewriteEngine on
#RewriteCond %{REQUEST_FILENAME} -f [OR]
#RewriteCond %{REQUEST_FILENAME} -d
#RewriteRule .* - [L]
#RewriteRule ^([^.]+)$ http://localhost/profile.php?u=$1 [NC]

On Github License

Files

Download PDF of Htaccess file
DEFLATE, HTTP_REFERER, QUERY_STRING, REQUEST_FILENAME, REQUEST_URI, SCRIPT_FILENAME, THE_REQUEST

Comments

Apache