Welcome to WebmasterWorld Guest from 54.166.178.177

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)

10+ Year Member



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)

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



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.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month