• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
301 permanent redirect with Code Igniter

#1
[eluser]sojic[/eluser]
I want to add 301 redirect non www to www

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

How to "combine" this with .htaccess code igniter rewrites? In the beginning, end.... some another flag???

.htaccess with Code Igniter which I use

Code:
RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php/$1 [L]

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

ErrorDocument 404 /index.php

#2
[eluser]HdotNET[/eluser]
Code:
RewriteEngine On
RewriteCond %{http_host} ^domain\.com [NC]
RewriteRule ^(.*) http://www.domain.com/$1 [R=301,L]

#code igniter stuff after

#3
[eluser]sojic[/eluser]
Thanks a lot, it works Smile


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.