SEO forum : Search Engine Optimization Forum

SEO forum : Search Engine Optimization Forum (http://www.seo-guy.com/forum/index.php)
-   Google (http://www.seo-guy.com/forum/forumdisplay.php?f=19)
-   -   .htaccess Code to Redirect the Page and Url (http://www.seo-guy.com/forum/showthread.php?t=14200)

ujjwalinfobase 09-19-2006 03:53 AM

.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)

Kate 09-21-2006 02:54 AM

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.