PHP help & guide for htaccess file configuration

.htaccess Configuration

Includes Writing module, pointing of domain.com to http://www.domain.com, and gzip compression

 

####Configuration for mod_rewrite used for wordpress

####Configuration to point domain.com to http://www.domain.com

 

#BEGIN WORDPRESS

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !^$

RewriteCond %{HTTP_HOST} !^domain\.com\ [NC]

RewriteRule ^/(.*) http://www.domain.com/$1 [R=permanent,L]

RewriteRule ^index\.php$ – [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

 

####Configuration for gzip compression

 

# compress text, html, javascript, css, xml:

AddOutputFilterByType DEFLATE text/plain

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/xml

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE application/xml

AddOutputFilterByType DEFLATE application/xhtml+xml

AddOutputFilterByType DEFLATE application/rss+xml

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/x-javascript

 

# Or, compress certain file types by extension:

SetOutputFilter DEFLATE

 

# END WordPress

 

 

Apache actually has two compression options:

mod_deflate – easier to set up and is standard.

mod_gzip – seems more powerful: you can pre-compress content.

Advertisements

Mag-iwan ng Tugon

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Baguhin )

Twitter picture

You are commenting using your Twitter account. Log Out / Baguhin )

Facebook photo

You are commenting using your Facebook account. Log Out / Baguhin )

Google+ photo

You are commenting using your Google+ account. Log Out / Baguhin )

Connecting to %s