This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Redirect in Apache Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "Redirect in Apache" Watch "Redirect in Apache" New topic
Author

Redirect in Apache

Pankaj Halder
Greenhorn

Joined: Sep 10, 2008
Posts: 25
I'm using Apache 2.2.10 (Unix), and want to redirect all the request of
http://mydoamin.com to http://www.mydomain.com

In my .htaccess, I added

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

But it does not work. Should I restart the server for the new .htaccess?

Or should I use httpd.conf instead of .htaccess?
 
GeeCON Prague 2014
 
subject: Redirect in Apache