Wordpress .HTACCESS File Generic Code
Here is what I have so far:
# BEGIN W3TC Browser Cache <IfModule mod_deflate.c> <IfModule mod_headers.c> Header append Vary User-Agent env=!dont-vary </IfModule> AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json <IfModule mod_mime.c> # DEFLATE by extension AddOutputFilter DEFLATE js css htm html xml </IfModule> </IfModule> # END W3TC Browser Cache # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress # BEGIN Disable Directory Browsing Options All -Indexes # END Disable Directory Browsing # BEGIN Prevent access to WP-Config <Files wp-config.php> order allow,deny deny from all </Files> # END Prevent access to WP-Config # BEGIN Protect HTACCESS file <Files ~ "^.*\.([Hh][Tt][Aa])"> order allow,deny deny from all satisfy all </Files> # END Protect HTACCESS file # BEGIN Canonical Domain Rewrite RewriteEngine On RewriteCond %{HTTP_HOST} ^mydomain\.co.uk$ [NC] RewriteRule ^(.*)$ http://www.mydomain.co.uk/$1 [R=301,L] # END Canonical Domain Rewrite # BEGIN Prevent Directory Browsing directory browsing Options All -Indexes # END Prevent Directory Browsing # BEGIN Prevent Hotlinking of images RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://domain.com/hot-link.gif [L] # END Prevent Hotlinking of images # BEGIN Custom 404 page ErrorDocument 404 /notfound.html # END Custome 404 page
-
Patrick -
Thanks - 1 reply
SignatureFreelance WordPress Developer | Free WordPress Themes | Free WordPress Plugins | Free WordPress Support{{ DiscussionBoard.errors[8139300].message }}-
prince55l -
Thanks - 1 reply
SignatureFlashlight | .htaccess redirect | Css button Generator| percent off calculator| lite 1.4| Mass converter|web hosting |groupon codes| Google pagerank checker|Words | Name meaning| coolmath4kids| Multiples{{ DiscussionBoard.errors[8142352].message }}-
1stranked -
Thanks
SignatureSSD VPS Servers starting from $5 - Click to apply!{{ DiscussionBoard.errors[8143182].message }} -
-
-
-
travelsoulja -
Thanks
{{ DiscussionBoard.errors[8139712].message }} -