tags:

views:

29

answers:

1

Hi all,

I have a quick question about .htaccess. Why does my site load faster when using this URL:

http://www.phaidi.com/network/index.php?p=home&s=chaumyvn

Than by going straight to the chaumy.vn domain?

I think it has something to do with my .htaccess, but I have not been able to fix it. See my .htaccess file below:

Options +FollowSymlinks
RewriteEngine on
RewriteBase /

ReWriteCond %{HTTP_HOST} chaumy.vn
ReWriteCond %{REQUEST_URI} !network/
ReWriteRule ^(.*)$ /network/index.php?p=$1&s=chaumyvn [R=301] 

<Files .htaccess>
order allow,deny
deny from all
</Files>

Any ideas?

A: 

I don't know if this will fix all the slowness, but a quick remark.

You are only excluding the network folder from the rewrite rule, however what about your static files (/css/, favicon etc.) They will all be rewriting to your network/index.php file as well.

Besides that for production environments (especially on high-traffic websites) I've heard it's better to put the 'htaccess' information straight into the apache/virtualhost configuration, as it saves Apache from having to scan for the htaccess and parse is for every request. But it shouldn't save 'that much' in this situation.

CharlesLeaf
Anders Palm
Your .htaccess doesn't say that it should change "hostnames" as well, maybe you are looking for a 301 redirect. Quick example I found on the googles for you: http://www.strangework.com/2008/06/30/how-to-301-redirect-from-one-domain-to-another-using-mod_rewrite/
CharlesLeaf