π LAMP π MySQL π Terminal π htaccess
RedirectMatch 301 /old_location(.*) http://newlocation.com/$1
Redirect permanent /old_folder http://www.example.com/newfolder
RedirectMatch "\.html$" http://www.example.com/index.php
RewriteEngine On
RewriteRule ^([_0-9a-zA-Z-]+/)?wordpress/uploads/(.+) files/$2 [L]
RewriteEngine On
RewriteRule ^short_filename.pdf /wp-content/uploads/real-file-location.pdf [L]
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 month"
ExpiresByType image/jpeg "access 1 month"
ExpiresByType image/gif "access 1 month"
ExpiresByType image/png "access 1 month"
ExpiresByType text/css "access 1 week"
ExpiresByType text/html "access 1 week"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/javascript "access 1 week"
ExpiresByType text/x-javascript "access 1 week"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 month"
ExpiresDefault "access 1 week"
</IfModule>
RewriteEngine on
RewriteBase /
RewriteRule /(.*) http://newwebsite.com/ [R=301,L]
AddType text/plain .pl
AddType text/plain .py
AddType text/plain .pyc
AddType text/plain .pyo
AddType text/plain .pyd
AddType text/plain .rb
AddType text/plain .so
AddType text/plain .cgi
<files ~ "^.htaccess">
Order allow,deny
Deny from all
</files>
<Files .htaccess>
order allow,deny
deny from all
</Files>
<files wp-config.php>
order allow,deny
deny from all
</files>
<files install.php>
order allow,deny
deny from all
</files>
<files *.ini>
order allow,deny
deny from all
</files>
<files readme.html>
order allow,deny
deny from all
</files>
<files bb-config.php>
order allow,deny
deny from all
</files>
<Files ~ "\.inc$">
Order allow,deny
Deny from all
</Files>
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://example.com/$1 [R,L]
ErrorDocument 404 /_publications/404.html
# no
IndexIgnore */*
# yes
Options +Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} example.com
RewriteRule ^robots.txt robots_disallow.txt