Force www. included in URL |
[eluser]iive[/eluser]
Hi, I would like to make sure all request to my site is in www.mysite.com instead of mysite.com. I do not know how to configure my .htaccess file to do that. I have googled it a bit and I got a solution for that.. but it doesn't work properly if I combined it with my current .htacess file which hide the index.php from the URL. .htaccess that force www in the url Code: RewriteCond %{HTTP_HOST} !^www.mysite.com$ .htaccess that hide index.php from url Code: <IfModule mod_rewrite.c>
[eluser]gon[/eluser]
To hide index.php from url, you can do what is said in the docs: http://ellislab.com/codeigniter/user-gui.../urls.html
[eluser]johnwbaxter[/eluser]
This is mine which does just that. I wont pretend to know what any of it means but it does work! RewriteBase / RewriteCond %{HTTP_HOST} !^www\.mysite\.co.uk$ [NC] RewriteRule ^(.*)$ http://www.mysite.co.uk/$1 [R=301,L] Hope it works for you!
[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> It is not written by me, I just combine these codes together here. |
Welcome Guest, Not a member yet? Register Sign In |