HTACCESS File for sitename.com to www.sitename.com etc

Discussion in 'Site & Server Administration' started by classicmario, Mar 11, 2014.

  1. #1
    Hello all,

    I am trying to make superluigibros.com redirect to www.superluigibros.com

    I've got it half working, its going superluigibros.com to www.superluigibros.com/index.php - anyone know how I can edit the codes to get rid of index.php?

    Another little thing I think I need to do in this file is this
    "Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network."

    It's from google pagespeed insights. Could anyone kindly tell me how I might fix these two issues? I've quoted my HTACCESS File below.

    If anyone can help that would be wonderful

    Thanks

    Luke
     
    classicmario, Mar 11, 2014 IP
  2. AveUgotaWkdSide

    AveUgotaWkdSide Active Member

    Messages:
    242
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Use this in your .htaccess file
    RewriteEngine On
    RewriteCond %{HTTP_HOST}  ^example.com [nocase]
    RewriteRule ^(.*)         http://www.example.com/$1 [last,redirect=301]
    Code (markup):
    Obviously change out the domain example.com for your domain
    More information on other techniques can be found here https://support.tigertech.net/redirect-www
     
    AveUgotaWkdSide, Mar 11, 2014 IP
  3. classicmario

    classicmario Greenhorn

    Messages:
    69
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    - Excellent, it works. Thanks mate.
     
    classicmario, Mar 11, 2014 IP