![]() |
.htaccess Code to Redirect the Page and Url
Hello
I use the redirect command in .htaccess file to redirect the pages. Any Body tell me what is the command or the syntax that i use in the following cases. I want the following Redirects 1] http://domainname.com to http://www.domainname.com 2] http://domainname.com/index.html to http://www.domainname.com 3] http://www.domainname.com/index.html to http://www.domainname.com 4] www.domainname.com to http://www.domainname.com Is the Code that you send used To Redirect all the Pages either in (Php,Asp,Html) |
Hi there,
I think you are talking about domain redirection out here so that u can direct all your non www traffic to www I think this will be useful in that case <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST}!^www\.example\.com RewriteRule (.*) http://www.example.com/$1 [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index\.html\ HTTP/ RewriteRule index\.html$ http://www.example.com/%1 [R=301,L] </IfModule> Replace example with your domain name.. |
| All times are GMT -8. The time now is 06:00 PM. |
Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.