IPB

Welcome Guest ( Log In )

 
Reply to this topicStart new topic
> 301 Redirect, 301 redirect using .htaccess
kumar
post Jul 29 2008, 08:31 AM
Post #1





Group: Verified NS Member
Posts: 5
Joined: 29-July 08
Member No.: 1,673



Hi,
I want to redirect my non www.domain.com to www.domain.com using 301 redirect through the .htaccess file, for this purpose i put the following lines of code on the .htaccess file but it did not redirect as expected.

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^peoplesearch.com [nc]
rewriterule ^(.*)$ http://www. peoplesearch.com/$1 [R=301,L]


So can you please help me to resolve this issue.


Thanks,
kumar
Go to the top of the page
 
+Quote Post
Duane
post Jul 29 2008, 11:07 AM
Post #2


Network Solutions Technical Support


Group: Administrators
Posts: 26
Joined: 23-June 08
From: PA, USA
Member No.: 1,318



QUOTE (kumar @ Jul 29 2008, 09:31 AM) *
Hi,
I want to redirect my non www.domain.com to www.domain.com using 301 redirect through the .htaccess file, for this purpose i put the following lines of code on the .htaccess file but it did not redirect as expected.

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^peoplesearch.com [nc]
rewriterule ^(.*)$ http://www. peoplesearch.com/$1 [R=301,L]


So can you please help me to resolve this issue.


Thanks,
kumar


Are you using UNIX?
.htaccess redirects will not work on Windows hosting packages.

for Windows, you can add some asp lines to the top of your ASP pages (before anything is written to the browser.)

CODE
Dim sURL:sURL = Request.ServerVariables("HTTP_HOST")
Dim sdomain:sdomain = split(sURL, ".")

If sdomain(1) <> "netsolhost" Then
If sdomain(0) <> "www" Then
newAdd = "http://www." & sURL
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", newAdd
End If
End If


- Duane
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
Tags
No Tag inserted yet

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version    Network Solutions © 2008 Time is now: 8th January 2009 - 11:53 PM
Domain Names | Web Hosting | Web Design | Shopping Cart Software | Online Marketing | SSL Certificates