Wallpaper Script Forum » Bug Support

Redirect From Non WWW to WWW (HELP)

(3 posts)
  1. masti
    Member

    I need a little help here...

    i want to redirect my domain from non wwww to www (even in the case you enter without www , it should be redirected to wwww.domain.com)

    I tried the following method :

    Added the following code in .htccess .. it working fine except when we enter yourdomain.com ... it is redirecting to www.yourdomain.com/index.php?&resource=

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

    I think there is a conflict with the existing .htaccess code which is

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?%{QUERY_STRING}&resource=$1 [L]

    PLEASE HELP ME IN THIS ISSUE.

    THANK YOU

    Posted 12 months ago #

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

    add after: RewriteEngine On

    enjoy :)

    Posted 12 months ago #
  3. masti
    Member

    Cool.. thanks mate :)

    Posted 12 months ago #

RSS feed for this topic

Reply

You must log in to post.