SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CodeIgniter 301 redirection through .ht access file

    How to redirect a index-page in main URL with www which main framework means site become in CodeIgniter. So how i redirect the main Domain with www & redirect index page to main Domain.

    I put the redirection code in .htaccess file but not Done.

  2. #2
    Community Advisor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,402
    Mentioned
    45 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    Usually you need to add something like this to your .htaccess file:
    Code:
    # force non-www domain
    RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
    RewriteRule (.*) http://example.com/$1 [R=301,L]
    but it needs to come before the other codeigniter-specific rewrite rules.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •