Permanently renaming a file or directory

Search Engine Optimization using Htaccess

Permanently renaming a file or directory

Postby produke » 03 Oct 2006 02:29

If you would like to rename your files or directories, but are worried about search engines or favorites that are linked to your old files or directories, add the following example to the .htaccess file. Just replace the filename and extension with your own.

Code: Select all
Redirect permanent /filename.html http://www.example.com/filename.php
User avatar
produke
 
Posts: 242
Joined: 25 Sep 2006 04:48

followup question to redirect some but not all files

Postby varocketry » 14 Mar 2007 20:58

Newbie question warning!

I have created a NEW version of my family genealogy website venturing into CSS stylesheet templates. I want to leave the OLDSITE available online as it contains a great deal of information, I plan to move all associated files into an OLDSITE directory.

I'd like the NEWSITE files to be accessible for all new visitors.

I would like to REDIRECT access to thirteen (13) of the OLDSITE root files to their new /OLDSITE location.

Ques 1. Can I have thirteen REDIRECT statements?
Ques 2. Is this syntax correct?
Code: Select all
Redirect permanent /abercrom.htm /oldsite/abercrom.htm


Ques 3. Do I repeat this code for all thirteen files (dissimilar names)?

Thanks
varocketry
 
Posts: 1
Joined: 14 Mar 2007 20:43

Postby produke » 23 Mar 2007 11:52

I would use 13 of the following..

Code: Select all
Redirect 302 /filename.html http://www.site.com/oldsite/abercrom.htm 



That is if you want users browsers to show http://www.site.com/oldsite/abercrom.htm instead of http://www.site.com/filename.html

If you don't want your users to know they are viewing files from another directory, you need to use mod_rewrite.. IF that is the case please ask any questions in the "Ask Questions" forum.

G'luck!
User avatar
produke
 
Posts: 242
Joined: 25 Sep 2006 04:48


Return to SEO



Who is online

Users browsing this forum: No registered users