Top VPS Hosting Provider

Welcome to the myhosting.com Forums.
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    sgoodman is offline Master Member
    Join Date
    Jul 2008
    Location
    Alberta, Canada
    Posts
    397

    Question Redirecting Visitors

    Greetings,

    How can I use a .htaccess file to redirect visitors to another web site?

    Thanks,
    Shane.
    Basic Linux Hosting on classic platform; Parallels Plesk Panel 10.3.1

  2. #2
    suwunk is offline Super Moderator
    Join Date
    Aug 2010
    Posts
    1,095

    Default

    Hi Shane,

    Hope this help!
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
    Redirect to www
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
    http://myhosting.com/forums/programming/1493-301.html

    Cheers

  3. #3
    sgoodman is offline Master Member
    Join Date
    Jul 2008
    Location
    Alberta, Canada
    Posts
    397

    Smile I finally solved it

    I finally figured it out:

    Code:
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^/intranet([/\w\.-]*)*\/?$ [NC]
    RewriteRule .* http://www.custompopups.com
    It took a long time to get it working because I had to exclude visitors to the intranet subdirectory. But it finally works. I also realized I'm posting in the wrong forum. This is actually for my classic hosting account.

    Shane.
    Basic Linux Hosting on classic platform; Parallels Plesk Panel 10.3.1


 

Similar Threads

  1. increasing unique visitors
    By OfftheWall in forum How-To
    Replies: 3
    Last Post: 2011-12-02, 02:30 PM

Posting Permissions

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