Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • redirect non-www to www url string using htaccess

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 110
    Comment on it

    There must be a situation where we need to redirects all non www requests to www. We can easily redirect user from non-www to www url string using following ways. for example , if a user makes a request for http://mysite.com/param1/param2, so with the help of .htaccess file we can easily rewrite the request in the browser as http://www.mysite.com/param1/param2

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

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: