# How to correct this? 301 redirect

**URL:** https://forum.kirupa.com/t/how-to-correct-this-301-redirect/264378
**Category:** Uncategorized
**Created:** [June 25, 2008, 3:59pm UTC](https://forum.kirupa.com/t/how-to-correct-this-301-redirect/264378 "2008-06-25T15:59:44Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![acc](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@acc](https://forum.kirupa.com/u/acc)
#### Post date: [June 25, 2008, 3:59pm UTC](https://forum.kirupa.com/t/how-to-correct-this-301-redirect/264378/1 "2008-06-25T15:59:44Z")

</div>

did this website grader and it has this note:

**Permanent Redirect Not Found** Search engines may think **[www.url.com](http://www.url.com)** and **[url.com](http://url.com)** are two different sites.You should set up a permanent redirect (technically called a “301 redirect”) between these sites. Once you do that, you will get full search engine credit for your work on these sites.

I know 301 redirect, when it comes to pages, but don’t really know how to go about this.  
where do i place the redirect lines and how do I query if they entered [www.url.com](http://www.url.com) or [url.com](http://url.com)?

thanks

---

<div class="post-metadata">

### Author: ![actionAction](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/actionaction/32/3987_2.png) [@actionAction](https://forum.kirupa.com/u/actionAction)
#### Post date: [June 25, 2008, 4:07pm UTC](https://forum.kirupa.com/t/how-to-correct-this-301-redirect/264378/2 "2008-06-25T16:07:44Z")

</div>

Create an .htaccess file and put this in it. Obviously change [url.com](http://url.com) to your domain:

```auto

Options +FollowSymLinks 

RewriteEngine on
RewriteCond %{HTTP_HOST} ^url.com [NC] 
RewriteRule ^(.*)$ http://www.url.com/$1 [L,R=301]

```

---

<div class="post-metadata">

### Author: ![Templarian](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/templarian/32/7152_2.png) [@Templarian](https://forum.kirupa.com/u/Templarian)
#### Post date: [June 25, 2008, 4:07pm UTC](https://forum.kirupa.com/t/how-to-correct-this-301-redirect/264378/3 "2008-06-25T16:07:55Z")

</div>

search .htaccess 301 redirect in google

//edit, or do what it says above…

---

<div class="post-metadata">

### Author: ![acc](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@acc](https://forum.kirupa.com/u/acc)
#### Post date: [June 25, 2008, 4:16pm UTC](https://forum.kirupa.com/t/how-to-correct-this-301-redirect/264378/4 "2008-06-25T16:16:12Z")

</div>

server is IIS (ASP) and when I was looking for info, correct me if I am wrong, that it cannot run .htaccess file

---

<div class="post-metadata">

### Author: ![actionAction](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/actionaction/32/3987_2.png) [@actionAction](https://forum.kirupa.com/u/actionAction)
#### Post date: [June 25, 2008, 4:34pm UTC](https://forum.kirupa.com/t/how-to-correct-this-301-redirect/264378/5 "2008-06-25T16:34:25Z")

</div>

You are correct, stupid IIS. Anyway, this link, though very old might help you: [http://www.xoc.net/works/tips/domain.asp](http://www.xoc.net/works/tips/domain.asp)

If you are on shared hosting, you may need to contact your hosting provider to have this done.

---

<div class="post-metadata">

### Author: ![acc](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@acc](https://forum.kirupa.com/u/acc)
#### Post date: [June 27, 2008, 1:38pm UTC](https://forum.kirupa.com/t/how-to-correct-this-301-redirect/264378/6 "2008-06-27T13:38:07Z")

</div>

would you suggest something like this? though I would have to put in every page, but is it an option?

\<%@ Language=VBScript %\>  
\<%  
If InStr(Request.ServerVariables(“SERVER\_NAME”),“www”) = 0 Then  
Response.Status="301 Moved Permanently"  
Response.AddHeader “Location”,"[http://www.sitename.com](http://www.sitename.com)"  
Request.ServerVariables(“HTTP\_HOST”)  
Request.ServerVariables(“SCRIPT\_NAME”)  
End if  
%\>

---

<div class="post-metadata">

### Author: ![icio](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/icio/32/484_2.png) [@icio](https://forum.kirupa.com/u/icio)
#### Post date: [June 27, 2008, 3:30pm UTC](https://forum.kirupa.com/t/how-to-correct-this-301-redirect/264378/7 "2008-06-27T15:30:37Z")

</div>

If you had set your DNS records up properly this wouldn’t be a problem.

---

<div class="post-metadata">

### Author: ![acc](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@acc](https://forum.kirupa.com/u/acc)
#### Post date: [June 27, 2008, 3:52pm UTC](https://forum.kirupa.com/t/how-to-correct-this-301-redirect/264378/8 "2008-06-27T15:52:10Z")

</div>

actually, I didn’t set it up and I don’t have access to the settings, it’s a company site. I would have to tell admin to do it.

---

<div class="post-metadata">

### Author: ![icio](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/icio/32/484_2.png) [@icio](https://forum.kirupa.com/u/icio)
#### Post date: [June 27, 2008, 7:14pm UTC](https://forum.kirupa.com/t/how-to-correct-this-301-redirect/264378/9 "2008-06-27T19:14:32Z")

</div>

If they’re employing someone to handle it, tell him to do his ■■■■ job.
