Welcome Guest, Not a member yet? Register   Sign In
[OK] SEO Question
#1

[eluser]Maxim7[/eluser]
Hello Smile

I'm coding with codeIgniter for one month. It's beautiful !

So my question:
I want to do all my link type:
http://mysite.com
to
http://www.mysite.com

How can I do it ?
Some tricks in CI ?
Or I have to do the .htaccess think

I tired this but don't work so good.
Code:
<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
    RewriteCond %{HTTP_HOST} !^www\.mysite\.com [NC]
    RewriteRule . http://www.mysite.com/$1 [QSA,R=301,L]
    
</IfModule>

Thanks Big Grin
#2

[eluser]n0xie[/eluser]
You have the order wrong.
Try this:

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{HTTP_HOST} !^www\.mysite\.com [NC]
    RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
#3

[eluser]Maxim7[/eluser]
Thank you !
Works well !




Theme © iAndrew 2016 - Forum software by © MyBB