Forum Moderators: phranque

Message Too Old, No Replies

.htaccess 301 redirect

301 redirect .htaccess

         

Scobee

5:31 am on Jan 25, 2007 (gmt 0)

10+ Year Member



Hello
How can i redirect http://www.example.com/name.php into http://www.example.com/name.html with an 301 redirect, so that the pagerank will be transfeered as well?
Thank you

[edited by: jdMorgan at 5:39 am (utc) on Jan. 25, 2007]
[edit reason] Example.com, please. [/edit]

jdMorgan

5:40 am on Jan 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



By taking out some of the words in your question and and re-arranging one number. :)

Redirect 301 /name.php http://www.example.com/name.html

For more info, see Apache mod_alias [httpd.apache.org].

Jim

TinkyWinky

11:18 am on Jan 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hopefully someone can help with this rather urgent issue - we have just bought a new site which is hosted on the following server :

Operating System OS: Red Hat Enterprise Linux, Version 4
Apache version 1.3.34 (Unix)

Basically I am used to working with Windows and know how to sort out server side 301 redirects.

Basically can I assume that I need to set up an .htaccess.txt file - then upload and remove the .txt via ftp.

If that's right, do I simply place the following code into the file to set up 301's from about 300 pages that are currently in the root folder that we want to move to other places around the site :

Redirect 301 /page1.htm [mydomain.com...]
Redirect 301 /page2.htm [mydomain.com...]
Redirect 301 /page3.htm [mydomain.com...]
Redirect 301 /page4.htm [mydomain.com...]
Redirect 301 /page5.htm [mydomain.com...]

etc etc.

(I then move the pages to the new folders as per the redirect instructions - leaving nothing in the root apart from .index.htm and .htaccess)

Or should I be using something along the lines of :

RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST}!^www\.MyDomain\.com
RewriteRule (.*) [MyDomain.com...] [R=301,L]

I am really confused. I stress these are all internal changes to simply tidy up about 300 files in the root that we want to move to a more structured architecture. No changes of text etc - hence using 301 redirects to ensure no duplicate content.

On another tack - if I do this will this cause the whole site to be 're-evaluated by google' and therefore lose all it's traffic and places on the SERPS (we have about 1.5 million impressions a month so it is quite critical)

Thanks for any help anyone can give - my techie is away and I need to get my head round this. I am not a techie but have a semblance of what to do - on Windows only :(.

Thanks again
TW

[edited by: TinkyWinky at 11:20 am (utc) on Jan. 25, 2007]

TinkyWinky

11:23 am on Jan 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just found this on the APache site:

Redirect permanent /one http://example.com/two

Should I therefore be using :

Redirect permanent /page1.htm [mydomain.com...]
Redirect permanent /page2.htm [mydomain.com...]
Redirect permanent /page3.htm [mydomain.com...]
Redirect permanent /page4.htm [mydomain.com...]
Redirect permanent /page5.htm [mydomain.com...]

Instead of redirect 301?

Sorry about all the questions - cheers.
TW

[edited by: TinkyWinky at 11:35 am (utc) on Jan. 25, 2007]

jdMorgan

4:50 pm on Jan 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Redirect 301, RedirectPermanent, and Redirect Permanent are equivalent.

See my response in the other thread [webmasterworld.com] you posted to regarding redirection versus internal rewriting.

Jim