working on it ...

Filters

Explore Public Snippets

Sort by

Found 2,066 snippets matching: htaccess

    public by afelicioni  362701  0  4  0

    second level domain trick

    second level domain trick: .htaccess
    RewriteEngine On
    Options +FollowSymlinks
    RewriteBase /
    
    #RewriteCond %{HTTP_HOST} !www.dns.it
    #RewriteCond %{HTTP_HOST} (.*).dns.it
    #RewriteRule ^(.*)$ %1/$1
    
    RewriteCond %{HTTP_HOST} whois.dns.it
    RewriteCond %{REQUEST_URI} !_whois/
    RewriteRule ^(.*)$ _whois/$1 [L]
    
    RewriteCond %{HTTP_HOST} tld-info.dns.it
    RewriteCond %{REQUEST_URI} !_tld-info/
    RewriteRule ^(.*)$ _tld-info/$1 [L]
    
    RewriteCond %{HTTP_HOST} tld.dns.it
    RewriteCond %{REQUEST_URI} !_tld-info/
    RewriteRule ^(.*)$ _tld-info/$1 [L]
    
    

    public by anibal copitan  170937  0  3  0

    Con www o sin www config .htaccess

    Con www o sin www config .htaccess: .htaccess-website
    #Force www:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example.com [NC]
    RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]
    
    
    #Force non-www:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
    RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
    
    

    public by garyoosterhuis  1999  10  6  1

    Block MySQL injections, RFI, base64, etc.

    # Block MySQL injections, RFI, base64, etc.
    
    #RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [OR]
    
    RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [OR]
    
    RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC,OR]
    
    RewriteCond %{QUERY_STRING} \=PHP[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} [NC,OR]
    
    RewriteCond %{QUERY_STRING} (\.\./|\.\.) [OR]
    
    #RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
    
    #RewriteCond %{QUERY_STRING} http\: [NC,OR]
    
    #RewriteCond %{QUERY_STRING} https\: [NC,OR]
    
    RewriteCond %{QUERY_STRING} \=\|w\| [NC,OR]
    
    #RewriteCond %{QUERY_STRING} ^(.*)/self/(.*)$ [NC,OR]
    
    RewriteCond %{QUERY_STRING} ^(.*)cPath=http://(.*)$ [NC,OR]
    
    RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
    
    RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
    
    RewriteCond %{QUERY_STRING} (\<|%3C).*iframe.*(\>|%3E) [NC,OR]
    
    RewriteCond %{QUERY_STRING} (<|%3C)([^i]*i)+frame.*(>|%3E) [NC,OR]
    
    RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
    
    RewriteCond %{QUERY_STRING} base64_(en|de)code[^(]*\([^)]*\) [NC,OR]
    
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    
    RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]
    
    RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)|<|>).* [NC,OR]
    
    RewriteCond %{QUERY_STRING} (NULL|OUTFILE|LOAD_FILE) [OR]
    
    RewriteCond %{QUERY_STRING} (\./|\../|\.../)+(motd|etc|bin) [NC,OR]
    
    RewriteCond %{QUERY_STRING} (localhost|loopback|127\.0\.0\.1) [NC,OR]
    
    RewriteCond %{QUERY_STRING} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
    
    RewriteCond %{QUERY_STRING} concat[^\(]*\( [NC,OR]
    
    RewriteCond %{QUERY_STRING} union([^s]*s)+elect [NC,OR]
    
    RewriteCond %{QUERY_STRING} union([^a]*a)+ll([^s]*s)+elect [NC,OR]
    
    RewriteCond %{QUERY_STRING} (;|<|>|'|"|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|drop|delete|update|cast|create|char|convert|alter|declare|order|script|set|md5|benchmark|encode) [NC,OR]
    
    RewriteCond %{QUERY_STRING} (sp_executesql) [NC]
    
    RewriteRule ^(.*)$ - [F,L]

    public by cbbeny  2732  0  5  0

    Redirect website to https

    RewriteEngine On
    RewriteCond %{HTTP:HTTPS} !on [NV]
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    

    public by cbbeny  1476  3  5  0

    Change root folder via htaccess

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR]
    RewriteCond %{HTTP_HOST} ^www.domain-name.com$
    RewriteCond %{REQUEST_URI} !folder/
    RewriteRule (.*) /folder/$1 [L]

    public by chilly_bang  1659  1  5  0

    301 Redirect /Homepage.aspx to the root

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{THE_REQUEST} ^.*/Homepage\.aspx 
    RewriteRule ^(.*)Homepage.aspx$ /$1 [R=301,L]
    </IfModule>

    public by anibal copitan  2260  0  3  0

    .htaccess Wordpress IPS availables http://www.isaelectricistas.pe/wp-admin OK (no works in hostgator)

    .htaccess Wordpress IPS availables http://www.isaelectricistas.pe/wp-admin OK (no works in hostgator): .htaccess-wordpress
    @fuente list config .htaccess : http://support.hostgator.com/articles/specialized-help/technical/apache-htaccess/apache-mod_rewrite-and-examples
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^isaelectricistas.pe [NC]
    RewriteRule ^(.*)$ http://www.isaelectricistas.pe/$1 [L,R=301,NC]
    
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    ## only acces to this IP HOUSE
    RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
    RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
    RewriteCond %{REMOTE_ADDR} !^201\.240\.5\.113$
    
    RewriteRule ^(.*)$ - [R=404,L]
    
    </IfModule>
    
    # END WordPress
    
    

    public by AndrewAspey  1808  1  3  0

    Magento .htaccess Tweak for Multisite

    Add this to .htaccess for multisite Magento
    SetEnvIf Host pixelento2web\.pixelpeopleltd\.co.uk MAGE_RUN_CODE=web_design_and_development
    SetEnvIf Host pixelento2web\.pixelpeopleltd\.co.uk MAGE_RUN_TYPE=website
    
    SetEnvIf Host pixelento2webmonthly\.pixelpeopleltd\.co.uk MAGE_RUN_CODE=pay_monthly_web_design
    SetEnvIf Host pixelento2webmonthly\.pixelpeopleltd\.co.uk MAGE_RUN_TYPE=website
    
    SetEnvIf Host pixelento2print\.pixelpeopleltd\.co.uk MAGE_RUN_CODE=print_and_media_design
    SetEnvIf Host pixelento2print\.pixelpeopleltd\.co.uk MAGE_RUN_TYPE=website
    
    SetEnvIf Host pixelento2hosting\.pixelpeopleltd\.co.uk MAGE_RUN_CODE=managed_web_hosting_service
    SetEnvIf Host pixelento2hosting\.pixelpeopleltd\.co.uk MAGE_RUN_TYPE=website

    public by Aleksandar Popovic  1610  0  3  0

    Codeigniter .htaccess

    Codeigniter .htaccess: .htaccess
    <IfModule mod_rewrite.c>
      RewriteEngine On
      # !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
      #  slashes.
      # If your page resides at
      #  http://www.example.com/mypage/test1
      # then use
      # RewriteBase /mypage/test1/
      RewriteBase /
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?/$1 [L]
    </IfModule>
     
    <IfModule !mod_rewrite.c>
      # If we don't have mod_rewrite installed, all 404's
      # can be sent to index.php, and everything works as normal.
      # Submitted by: ElliotHaughin
     
      ErrorDocument 404 /index.php
    </IfModule>
    
    

    public by AbhishekGhosh  204  0  2  0

    WordPress, W3TC extra .htaccess

    WordPress, W3TC extra .htaccess: .htaccess
    ### stanza for brotli starts ###
    <IfModule mod_headers.c>
      # Serve brotli compressed CSS files if they exist and the client accepts brotli.
      RewriteCond %{HTTP:Accept-encoding} br
      RewriteCond %{REQUEST_FILENAME}\.br -s
      RewriteRule ^(.*)\.css $1\.css\.br [QSA]
    
      # Serve gzip compressed CSS files if they exist and the client accepts gzip.
      RewriteCond %{HTTP:Accept-encoding} gzip
      RewriteCond %{REQUEST_FILENAME}\.gz -s
      RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
    
      # Serve brotli compressed JS files if they exist and the client accepts brotli.
      RewriteCond %{HTTP:Accept-encoding} br
      RewriteCond %{REQUEST_FILENAME}\.br -s
      RewriteRule ^(.*)\.js $1\.js\.br [QSA]
    
      # Serve gzip compressed JS files if they exist and the client accepts gzip.
      RewriteCond %{HTTP:Accept-encoding} gzip
      RewriteCond %{REQUEST_FILENAME}\.gz -s
      RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
    
      # Serve correct content types, and prevent mod_deflate double gzip.
      RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
      RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]
      RewriteRule \.css\.br$ - [T=text/css,E=no-gzip:1]
      RewriteRule \.js\.br$ - [T=text/javascript,E=no-gzip:1]
    
      <FilesMatch "(\.js\.gz|\.css\.gz)$">
        # Serve correct encoding type.
        Header set Content-Encoding gzip
        # Force proxies to cache gzipped & non-gzipped css/js files separately.
        Header append Vary Accept-Encoding
      </FilesMatch>
      <FilesMatch "(\.js\.br|\.css\.br)$">
        # Serve correct encoding type.
        Header set Content-Encoding br
        # Force proxies to cache gzipped & non-gzipped css/js files separately.
        Header append Vary Accept-Encoding
      </FilesMatch>
    </IfModule>
    ### stanza for brotli ends ###
    
    
    • Public Snippets
    • Channels Snippets