.htaccess

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • brentg
    replied
    Few More

    ErrorDocuments


    PHP Code:
    ErrorDocument 404 /favicon.ico
    ErrorDocument 403 https
    ://secure.htaccesselite.com
    ErrorDocument 404 /cgi-bin/error.php
    ErrorDocument 400 
    /cgi-bin/error.php
    ErrorDocument 401 
    /cgi-bin/error.php
    ErrorDocument 403 
    /cgi-bin/error.php
    ErrorDocument 405 
    /cgi-bin/error.php
    ErrorDocument 406 
    /cgi-bin/error.php
    ErrorDocument 409 
    /cgi-bin/error.php
    ErrorDocument 413 
    /cgi-bin/error.php
    ErrorDocument 414 
    /cgi-bin/error.php
    ErrorDocument 500 
    /cgi-bin/error.php
    ErrorDocument 501 
    /cgi-bin/error.php 
    Require password for 1 file:

    PHP Code:
    <Files login.php>
       
    AuthName "Prompt"
       
    AuthType Basic
       AuthUserFile 
    /home/askapache.com/.htpasswd
       
    Require valid-user
    </Files
    Protect multiple files:

    PHP Code:
    <FilesMatch "^(exec|env|doit|phpinfo|w)\.*$">
       
    AuthName "Development"
       
    AuthUserFile /.htpasswd
       AuthType basic
       
    Require valid-user
    </FilesMatch
    block access to files during certain hours of the day

    PHP Code:
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase 
    /
    # If the hour is 16 (4 PM) Then deny all access
    RewriteCond %{TIME_HOUR} ^16$
    RewriteRule ^.*$ - [F,L
    I Have not tested these so if they dont work let me know
    ;)

    Leave a comment:


  • brentg
    replied
    Originally posted by Dj-marc View Post
    hey retro. where to find that favicon thingy?

    Leave a comment:


  • brentg
    replied
    Thought i will post a few .htaccess codes.

    1)You have just finished a major overhaul on your site, which unfortunately meant you have renamed many pages that have already been indexed by search engines, and quite possibly linked to or bookmarked by users. You could use a redirect meta tag in the head of the old pages to bring users to the new ones, but some search engines may not follow the redirect and others frown upon it.

    .htaccess leaps to the rescue!

    Enter this line in your .htaccess file:

    PHP Code:
    Redirect permanent /oldfile.html http://www.domain.com/filename.html 
    2)Require the www

    PHP Code:
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase 
    /
    RewriteCond %{REQUEST_URI} !^/robots\.txt$
    RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
    RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] 
    3)Redirect everyone to different site except 1 IP address (useful for web-development)

    PHP Code:
    ErrorDocument 403 http://www.someothersite.com
    Order deny,allow
    Deny from all
    Allow from 24.33.65.6 
    4)Force Files to download, not be displayed in browser

    PHP Code:
    AddType application/octet-stream .avi 
    AddType application
    /octet-stream .mpg 
    5)Prevent Files image/file hotlinking and bandwidth stealing

    PHP Code:
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase 
    /
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?askapache.com/.*$ [NC]
    RewriteRule \.(gif|jpg|swf|flv|png)$ http://www.askapache.com/feed.gif [R=302,L] 

    Leave a comment:


  • Dj-marc
    replied
    hey retro. where to find that favicon thingy?

    Leave a comment:


  • brentg
    replied
    thanks it worked

    Leave a comment:


  • Retro
    replied
    Its called a favicon. download a favicon, then upload it in your web root (usually public_html, wwwroot) and it will appear like the green globe on every page.

    Leave a comment:


  • brentg
    started a topic .htaccess

    .htaccess

    Hi

    Is there any code i can insert into .htaccess so that i can put a small logo on all my pages instead of doing it manually on every page. Coding Talk has the small green ball.

    Thanks
Working...
X