Posts Tagged .htaccess

How to reset the htaccess rules for sub folders

Normally htaccess rules applied to all folder and subfolder also, if we need to restrict one of the sub folder then we need to use the redirect condition like below

# subfolder
RewriteCond %{HTTP_HOST} ^example.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteCond %{REQUEST_URI} !^/website/
RewriteCond %{REQUEST_URI} !^/somefolder/
RewriteCond %{REQUEST_URI} !^/client/blabla/
RewriteRule (.*) /website/$1

that above code will apply redirect rules except the three folders “website”, “somefolder”, “client/blabla/”. but that one is hard to include all rules using the rewrite condition some times above code may help to exclude the directory.

At last i found one simple solution to avoid the sub folders using this code, we just need to create the “.htaccess” files and put the below code

RewriteOptions inherit

that above code will reset all rules from parent htaccess files so now we can easily install drupal / joomla inside the wordpress site else vice versa.

 

Posted in: Uncategorized, Web Developers/Designers Reference Guide

Leave a Comment (0) →

Embedding Images

To increasing the website performance we need to reduce the http requests, which can be achieved by CSS Sprites. Sprite images require only one http request to load many number of images but that one is difficult to construct and there is no automated tool available to do the same. So i suggest Data URI as alternative.

First i like to tell the Pros and Cons of Data URI

Pros: 

  • Quicker loading
  • no file storage required

Cons:

  • Images can take up almost three times more storage space (that one can be over come using the Gzip compression method).
  • your website can be seen as a spam site because many spam sites use base64 to force browsers to load images.
  • Internet Explorer 5-7 version not supported the Data URI

Steps to do Data URI

Some Useful Data URI Examples.

Data URI for empty.gif

<img src=”data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D” width=1 height=1>

The empty favicon is created with the LINK element

Using this technique we can able to attain 99/100 for google page speed…

Posted in: Uncategorized, Web Developers/Designers Reference Guide

Leave a Comment (0) →