Welcome to WebmasterWorld Guest from 23.22.140.143

Forum Moderators: phranque

Message Too Old, No Replies

Forward to WWW

forwarding your domain to www address

     
7:07 pm on Mar 6, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 22, 2003
posts:64
votes: 0


I am wondering how I can setup my Redhat Linux box to forward any traffic that goes to the address mydomainexample.com to www.mydomainexample.com.

This must also work for pages within the site such as mydomainexample.com/site/it/exam/ should go to www.mydomainexample.com/site/it/exam/

Thanks ahead of time

7:30 pm on Mar 6, 2004 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 31, 2003
posts:9063
votes: 2


Assuming you're running Apache on your Linux box, you should add this to httpd.conf or to the .htaccess file in your document root:

Options +FollowSymLinks 
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule ^(.*)$ [example.com...] [R=301,L]

You need mod_rewrite enabled, of course.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members