Almost Perfect htaccess File for WordPress Blogs

Тема в разделе "Wordpress", создана пользователем roddik, 15 сен 2007.

Статус темы:
Закрыта.
Модераторы: Sorcus
  1. roddik

    roddik Колбаска

    Регистр.:
    26 янв 2007
    Сообщения:
    351
    Симпатии:
    285
    1. Protects itself (security)
    2. Turns the digital signature off (security)
    3. Limits upload size (security)
    4. Protects wp-config.php (security)
    5. Gives access permission to all visitors with exceptions (security, usability)
    6. Specifies custom error documents (usability)
    7. Disables directory browsing (security)
    8. Redirect old pages to new (optional)
    9. Disables image hotlinking (bandwidth)
    10. Enables PHP compression (bandwidth)
    11. Sets the canonical or “standard” url for your site (seo, usability)

    Код:
    # protect the htaccess file
      <files .htaccess>
      order allow,deny
      deny from all
      </files>
     # disable the server signature
      ServerSignature Off
     # limit file uploads to 10mb
      LimitRequestBody 10240000
     # protect wpconfig.php
      <files wp-config.php>
      order allow,deny
      deny from all
      </files>
     #who has access who doesnt
      order allow,deny
      #deny from 000.000.000.000
      allow from all
     #custom error docs
      ErrorDocument 404 /notfound.php
      ErrorDocument 403 /forbidden.php
      ErrorDocument 500 /error.php
     # disable directory browsing
      Options All -Indexes
     #redirect old to new
      Redirect 301 /old.php http://www.yourdomain.com/new.php
     #block referring domains
      RewriteEngine on
      RewriteCond %{HTTP_REFERER} digg\.com [NC]
      RewriteRule .* - [F]
     #disable hotlinking of images with forbidden or custom image option
      RewriteEngine on
      RewriteCond %{HTTP_REFERER} !^$
      RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com/.*$ [NC]
      #RewriteRule \.(gif|jpg)$ - [F]
      #RewriteRule \.(gif|jpg)$ http://www.yourdomain.com/stealingisbad.gif [R,L]
     # php compression - use with caution
      <ifmodule mod_php4.c>
      php_value zlib.output_compression 16386
      </ifmodule>
     # set the canonical url
      RewriteEngine On
      RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC]
      RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]
     # protect from spam comments
      RewriteEngine On
      RewriteCond %{REQUEST_METHOD} POST
      RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
      RewriteCond %{HTTP_REFERER} !.*yourdomain.com.* [OR]
      RewriteCond %{HTTP_USER_AGENT} ^$
    RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]
    
    stolen from http://www.josiahcole.com/2007/07/11/almost-perfect-htaccess-file-for-wordpress-blogs/
     
  2. Cosmo

    Cosmo WGT

    Заблокирован
    Регистр.:
    19 мар 2006
    Сообщения:
    469
    Симпатии:
    307

    Вложения:

    • robot_p.rar
      Размер файла:
      640 байт
      Просмотров:
      6
    nekko нравится это.
Статус темы:
Закрыта.