Skip to content

Instantly share code, notes, and snippets.

@pascalknecht
Forked from enrikberisha/.htpasswd
Created May 18, 2018 12:12
Show Gist options
  • Select an option

  • Save pascalknecht/8136dba508a70cfc0f55d701db71fbcd to your computer and use it in GitHub Desktop.

Select an option

Save pascalknecht/8136dba508a70cfc0f55d701db71fbcd to your computer and use it in GitHub Desktop.

Revisions

  1. @enrikberisha enrikberisha revised this gist Feb 5, 2018. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions wp-content .htaccess
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    Order deny,allow
    Deny from all
    <Files ~ ".(xml|css|jpe?g|png|gif|js|ttf|woff|svg|woff2|eot|pdf|docx|rtf|odf|zip|rar)$">
    Allow from all
    </Files>
  2. @enrikberisha enrikberisha revised this gist Feb 5, 2018. 1 changed file with 35 additions and 0 deletions.
    35 changes: 35 additions & 0 deletions WK Muster .htaccess (inkl. twig)
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    # BEGINTWIG special
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} .twig$
    RewriteRule . /index.php [L]
    </IfModule>
    # END Twig special

    # BEGIN WKCustom

    # Disable Directory Browsing
    Options -Indexes
    <files wp-config.php>
    order allow,deny
    deny from all
    </files>

    # BEGIN block author scans
    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} (author=\d+) [NC]
    RewriteRule .* - [F]
    # END block author scans

    <IfModule mod_rewrite.c>
    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]
    </IfModule>

    # END WKCustom
  3. @enrikberisha enrikberisha revised this gist Oct 6, 2017. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions .htpasswd
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <IfModule mod_rewrite.c>
    RewriteEngine On
    AuthType Basic
    AuthName "BETA Site"
    AuthUserFile "/var/www/vhosts/rederp.ch/html/_beta.rederp.ch/.htpasswd"
    Require valid-user
    </IfModule>

    wk:$apr1$R.JuDQ11$V6oReBCgR7Jc52.JJG6n9/
  4. @enrikberisha enrikberisha revised this gist Mar 27, 2017. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion Force www.
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,7 @@
    #Redirect All
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
    RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

    #Redirect all without Subdomains
    RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
    RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]
  5. @enrikberisha enrikberisha revised this gist Mar 27, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Force www.
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
  6. @enrikberisha enrikberisha revised this gist Mar 2, 2017. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions Use Uploades from Live Server
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <IfModule mod_rewrite.c>
    RewriteEngine on
    # Attempt to load files from production if
    # they're not in our local version
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule wp-content/uploads/(.*) \
    http://{PROD}/wp-content/uploads/$1 [NC,L]
    </IfModule>
  7. @enrikberisha enrikberisha revised this gist Mar 1, 2017. 2 changed files with 4 additions and 0 deletions.
    File renamed without changes.
    4 changes: 4 additions & 0 deletions redirect 301
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^cutisonic.info$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.cutisonic.info$
    RewriteRule ^/?$ "https\:\/\/www\.cutisonic.eu/" [R=301,L]
  8. @enrikberisha enrikberisha created this gist Feb 13, 2017.
    18 changes: 18 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #BEGIN Force SSL
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    </IfModule>
    #END Force SSL

    # 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