This Blog is intended to collect information of my various Intrests,pen my opinion on the information gathered and not intended to educate any one of the information posted,but are most welcome to share there view on them
Friday, July 8, 2011
How to redirect an URL in Apache web server
URL redirection, also called URL forwarding and domain redirection also called domain forwarding
To redirect oldserver.com to newserver.com, add the following line in the httpd.conf file
RedirectPermanent / "http://www.newserver.com/"
Sample httpd.cong
< VirtualHost 192.168.1.1:* >
DocumentRoot /var/www/html/web/
ServerName oldserver.com
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
< Directory "/var/www/html/web" >
allow from all
Options -Indexes
DirectoryIndex index.html
RedirectPermanent / "http://www.newserver.com/"
< /Directory >
< /VirtualHost >