File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redirect in Apache