Forums / General Questions / trying to set up a 301 redirect by editing .htaccess file

trying to set up a 301 redirect by editing .htaccess file

Locked

Started by eggrush on 6 Mar 2009, 3:42 PM · Views: 1,992

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
6 Mar 2009, 3:42 PM
#1
eggrush avatar

eggrush

Zen Follower

Join Date:
Apr 2007
Posts:
153
Plugin Contributions:
0

trying to set up a 301 redirect by editing .htaccess file

Hi
i have opened this file up with bbedit and also gone onto my server cpanal>edit code, but there seems to be no code in there is this correct? i am trying to set up a 301 redirect as i have just done a website grade from website.grader.com and they say my site has **Permanent Redirect Not Found

any ideas how to get this to work.
**

6 Mar 2009, 5:35 PM
#2
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: trying to set up a 301 redirect by editing .htaccess file

Need more information to provide a good answer.

Steps to reproduct the problems would be helpful as well.

The learning is in the doing.

Potent Products

7 Mar 2009, 5:17 AM
#3
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,326
Plugin Contributions:
41

Re: trying to set up a 301 redirect by editing .htaccess file

http://www.beyondink.com/howtos/301-redirect.php

Don't edit files like the ones above in anything like BB code.... PLain old notepad.. NOT wordpad or MS word.

PSPad works great and has added notepad function - Freeware

~Melanie

7 Mar 2009, 12:39 PM
#4
eggrush avatar

eggrush

Zen Follower

Join Date:
Apr 2007
Posts:
153
Plugin Contributions:
0

Re: trying to set up a 301 redirect by editing .htaccess file

i followed the link you gave me and i see this code but i really dont know the purpose of what i am doing, a redirect to me sounds like i am going to one url and that is telling me to goto another, why would i want to do that at a guess i am thinking its an error page thing?, silly question i know but i haven't really looked into this i am just going on what that website grader said:

PHP 4 and PHP 5

Single Page Redirect:

<?php header('HTTP/1.1 301 Moved Permanently'); header('Location: <http://www.new-url.com/'%29;> ?>

Canonical Hostname Redirect (non-www to www):

<%
If InStr(Request.ServerVariables("SERVER_NAME"),"www") = 0 Then
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www." & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
Response.End
End if
%>

7 Mar 2009, 1:38 PM
#5
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,326
Plugin Contributions:
41

Re: trying to set up a 301 redirect by editing .htaccess file

Then back to Rob's answer we need more information... the codes you posted do not belong in your htaccess.

~Melanie