Welcome Guest, Not a member yet? Register   Sign In
Force www. included in URL
#4

[eluser]iive[/eluser]
After I searched around,this is solution that I found which hide index.php from url and append www. for every request to the server. I hope it helps someone who want to have both features.

Code:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.com [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]
RewriteCond $1 !(.jpg|.gif|.png|.swf|.css|.js|.txt)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

It is not written by me, I just combine these codes together here.


Messages In This Thread
Force www. included in URL - by El Forum - 03-26-2008, 03:20 AM
Force www. included in URL - by El Forum - 03-26-2008, 03:46 AM
Force www. included in URL - by El Forum - 03-26-2008, 03:47 AM
Force www. included in URL - by El Forum - 03-26-2008, 04:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB