Sunday, November 2, 2008

.htaccess का केही टिप्स

पेज एक्सटेन्शन विनाको वेव पेज र डायनामिक कन्टेन भएको html वेव पेज देखेर कसरी यस्तो गर्न सकिन्छ भनेर वुझ्दै जाँदा कन्ट्रोल प्यानेल भित्र root डिरेक्ट्रीमा हुने .htaccess मा तल दिए अनुसार गर्यो भने धेरै थोक हुदो रहेछ। तर मैले चाहे जस्तो पेज एक्सटेन्शन विनाको वेव पेज र डायनामिक कन्टेन भएको html पेज वनाउन दिएको ईन्सट्रक्सन अनुसार गर्दा सफल हुन सकिन। शायद हुन्छ होला तर अहिले लाई टेष्टेड ईन्सट्रक्सन.....................

(यो सव गर्दा साईट नचल्न पनि सक्छ तर यो सव गर्नलाई तपाँईकै रिक्स मा)

Enable Directory Browsing

Options +Indexes
## block a few types of files from showing
IndexIgnore *.wmv *.mp4 *.avi

Disable Directory Browsing

Options All -Indexes

Custom Error Message Pages

ErrorDocument 403 /somePage1.html
ErrorDocument 404 /somePage2.html
ErrorDocument 500 /somePage3.html

Change Default Page Order

DirectoryIndex myhome.htm index.htm index.php

Ban User IPs

order deny,allow
deny from 123.456.789.00
deny from 123.456.789.00
deny from .someDomain.com
allow from all

Block Visitors From Specific Referring Sites

RewriteEngine on
RewriteCond %{HTTP_REFERER} site-to-block.com [NC]
RewriteCond %{HTTP_REFERER} site-to-block-2.com [NC]
RewriteRule .* - [F]

Block Search Spiders From Specific Directories

User-agent: *
Disallow: /cgi-bin/
Disallow: /images/

Block Specific Search Spiders From Site

User-agent: searchbot1
User-agent: searchbot2
Disallow: /

No comments:

Post a Comment

तपाँईको सल्लाह सुझाव सदैव स्वागत गरीने छ।