Showing posts with label .htaccess. Show all posts
Showing posts with label .htaccess. Show all posts

htaccess code to block specific id address

Saturday, November 19, 2011

htaccess code to block specific id address.

If your blog is popular then, spammer will leave comments in your blog. You can control those spammer by using using the .htaccess file in the root folder of your website.

Code:
<limit get=”" post=”" put=”">
order allow,deny
allow from all
deny from 10.27.32.70
</limit>

You have to replace the 10.27.32.70 IP address with the given spammer’s IP. To add multiple IPs, simply add more deny lines.

<limit get=”" post=”" put=”">
order allow,deny
allow from all
deny from 10.27.32.70
deny from 20.90.20.70
deny from 90.60.60.80
deny from 40.80.30.90
</limit>

Website will not show updated design!!!

Thursday, September 15, 2011


Some times your website code content changes will not appear on the Website page. In that case you need to enter the following code in your .htaccess file.

How to create .htacces file

Header set Cache-Control: "private, pre-check=0, post-check=0, max-age=0"
Header set Expires: 0
Header set Pragma: no-cache

Note: Only for UNIX platform.

Weebly [an error occurred while processing this directive]

Sunday, September 4, 2011

[an error occurred while processing this directive] error at the footer of the website. This can be resolved by updating the following code in .htaccess:
AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php .php .htm .html
2. If the RSS feed URL is not working or getting errors related to RSS feed, then you need to update the .htaccess with the following code:
#Support Addition
RewriteEngine On
# check if requested file exists
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
# if not, pass it to 404.php
RewriteRule ^(.*) /404.php [L]
#Support Addition End

Applicable to ipage, IPOWER, Bizland, Readyhosting, Startlogic

404 and 500 error page for seo

Monday, August 1, 2011

If your website could not find the page in the server, then website will get 404 error (page not found). In this case Google will stop crawling your whole website because of broken link . To avoid that, you need to replace this error by creating Custom error page:

You can replace this error page by using .htaccess code.

Codes are:
ErrorDocument 403 http://domain.com/Custom error page.html
ErrorDocument 500 http://domain.com/Custom error page.html


Create .htaccess file and upload it to root directory.

To create the custom error page, please follow the steps given below:
 1. Create customer error page and upload it to website root eg: http://domain.com/Custom error page.html (this 'Custom error page.html' page will replace the error 403 or 500)

Likewise you can create custom error page for other errors.But, you should know the error codes.

Don't redirect your 404 or 500 custom error page to your homepage link(index page) insted of that, create one custom error page and give suggestions on what your reader can do to find the missing page (you can do it, by comment on the custom error page. ex:"Page is removed, please go back to home page)".

Hotlink prevent unauthorized URL using your images

Sunday, July 31, 2011

Hotlink prevent unauthorized URLs from loading files within specified directories at your site, which uses your bandwidth (also called bandwidth theft and leeching).
Example: Other website using your website image URL to show image on their website.

You can avoid that by creating .htaccess code.


Code:
# Begin hotlink protection #
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domainallow1.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://domainallow2.com/.*$ [NC]
RewriteRule .(gif|jpg|png)$ http://www.image.com/test.gif[R]
# End hotlink protection #


Create htaccess file and upload this .htaccess file to directory where your website files are located.

Here htacces code (hotlink protection) will allow domain 'domainallow1.com' and 'domainallow2.com' to access your website images.

RewriteRule .(gif|jpg|png)$ http://www.image.com/ [R] , it will restrict any other domains rather than  'domainallow1.com' and 'domainallow2.com'  to access your website  image and it will directly point to http://www.image.com/test.gif (you need to create this link) .

Here files are 'gif', 'jpg' and 'png'. You need to make changes in this line RewriteRule .(gif|jpg|png) .

Applicable to iPage, fatcow, Bizland, Ipower, Readyhosting, Startlogic (*only UNIX server).

What is 301 redirect?

Friday, February 4, 2011

301 redirect is the best method used to preserve the current search engine rankings when redirecting web pages or a website. After the code, the URL of the missing or renamed page is noted, followed by a space, then followed by the new location or file name.

You can implement the 301 redirect by creating a .htaccess file.

What is a .htaccess file?
The .htaccess file contains specific instructions for certain requests, it includes security, redirection and how to handle the customer error page.

To create a .htaccess file, please follow the steps given below:
1. Open the notepad name and save the file as .htaccess.
2. Upload the .htaccess file to server..
3. On the .htaccess file place the code.

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^olddomainname.com [nc]
rewriterule ^(.*)$ http://www.newdomain.com/$1 [r=301,nc]

(Note: Replace the old domain name and new domain)

4. Save the .htaccess file
5. Just test it by typing in the old address to the page you’ve
changed. You should be immediately taken to the new
location.

Notes: Don’t add “http://www” to the first part of the statement. This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

During the next update, the old file name and path will be
dropped and replaced with the new one.

To know more about click on the link:

http://www.htaccesseditor.com/

Forbidden You don’t have permission to access / on this server.

Tuesday, February 1, 2011

You don’t have permission to access / on this server.
The main reason for the error when you logging in to the site “admin” page to make edits, many times mod_security alerts are triggered. Mod_security will prevent you from making edits and you will get the error code that is configured within mod_security. The error code such as 599 is mod_security is related to this.

To resolve the issue you need to add the following code in the root directory of the .htaccess file.
SecFilterEngine Off
SecFilterScanPOST Off
SecRule REMOTE_ADDR “^111\.111\.11\.111$” phase:1,nolog,allow,ctl:ruleEngine=Off

Here “^111\.111\.11\.111$” is ip address of your desktop.
 

Most Reading

Sidebar One

+1-800-574-0902 +44-20-7993-2673 (ID: 173296)