Announcement

Collapse
No announcement yet.

Redirect http:// to http://www using .htaccess

Collapse
This topic is closed.
X
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Redirect http:// to http://www using .htaccess

    Paste the following code below into your .htaccess file located in public_html/*

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www.google.com [NC]
    RewriteRule ^(.*)$ http://www.google.com/$1 [R=301,L]
    Which will redirect

    http://google.com
    to http://www.google.com

    Very useful for scripts which detect if you are logged in from a specific domain

    *This will only work with servers that have .htaccess files enabled within their apache config - WHUK offer cPanel / Shared Linux packages which offer this service
    Webhosting.UK.com || cPanel VPS Hosting || Reseller Hosting

    Sales: 0808-262-0855
    Support: 0800-612-8725
    International: +44 191 303 8191
Working...
X