PHP help & guide for htaccess file configuration

.htaccess Configuration

Includes Writing module, pointing of to, and gzip compression


####Configuration for mod_rewrite used for wordpress

####Configuration to point to



RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !^$

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

RewriteRule ^/(.*)$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.


Mag-iwan ng Tugon

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

You are commenting using your 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