Jump to content
TNG Community

htaccess when moving files / changing CMS


Rush

Recommended Posts

I thought I would post a good way to redirect search engines, outside links, etc when you change to a CMS or change directories of where TNG is at:

Here is what part of my htaccess file looks:


Redirect 301 /cemphototrans.php http://www.bythedrop.com/page.php?1
Redirect 301 /mostwanted.php http://www.bythedrop.com/page.php?4
RedirectMatch 301 ^/getperson.php(.*) http://www.bythedrop.com/e107_plugins/tngIL/getperson.php$1
RedirectMatch 301 ^/surnames.php(.*) http://www.bythedrop.com/e107_plugins/tngIL/surnames.php$1
Redirect 301 /whatsnew.php http://www.bythedrop.com/e107_plugins/tngIL/whatsnew.php
Redirect 301 /browsephotos.php http://www.bythedrop.com/e107_plugins/tngIL/browsephotos.php
Redirect 301 /cemeteries.php http://www.bythedrop.com/
Redirect 301 /browsenotes.php http://www.bythedrop.com/e107_plugins/tngIL/browsenotes.php
Redirect 301 /browsesources.php http://www.bythedrop.com/
RedirectMatch 301 ^/places.php(.*) http://www.bythedrop.com/e107_plugins/tngIL/places.php$1
Redirect 301 /anniversaries.php http://www.bythedrop.com/
Redirect 301 /reports.php http://www.bythedrop.com/
RedirectMatch 301 ^/browsetrees.php(.*) http://www.bythedrop.com/e107_plugins/tngIL/browsetrees.php$1
Redirect 301 /showheadstone.php http://www.bythedrop.com/
RedirectMatch 301 ^/pedigree.php(.*) http://www.bythedrop.com/e107_plugins/tngIL/pedigree$1
Redirect 301 /descend.php http://www.bythedrop.com/
Redirect 301 /relateform.php http://www.bythedrop.com/
Redirect 301 /timeline2.php http://www.bythedrop.com/
RedirectMatch 301 ^/showmap.php(.*) http://www.bythedrop.com/e107_plugins/tngIL/showmap.php$1
Redirect 301 /suggest.php http://www.bythedrop.com/
RedirectMatch 301 ^/familygroup.php http://www.bythedrop.com/e107_plugins/tngIL/familygroup.php$1
Redirect 301 /search.php http://www.bythedrop.com/
RedirectMatch 301 ^/showphoto.php(.*) http://www.bythedrop.com/e107_plugins/tngIL/showphoto.php$1
Redirect 301 /searchform.php http://www.bythedrop.com/
Redirect 301 /showlog.php http://www.bythedrop.com/
Redirect 301 /showhistory.php http://www.bythedrop.com/
Redirect 301 /extrastree.php http://www.bythedrop.com/
RedirectMatch 301 ^/pedigree.php(.*) http://www.bythedrop.com/e107_plugins/tngIL/pedigree.php$1
Redirect 301 /ultraped.php http://www.bythedrop.com/
Redirect 301 /ahnentafel.php http://www.bythedrop.com/
Redirect 301 /placesearch.php http://www.bythedrop.com/
redirect 301 /timeline.php http://www.bythedrop.com/
A brief explaination:

Redirect 301 /cemphototrans.php http://www.bythedrop.com/page.php?1

this is a straight one page redirect.  When someone goes to http://www.bythedrop.com/cemphototrans.php they will automatically get kicked over to http://www.bythedrop.com/page.php?1

RedirectMatch 301 ^/getperson.php(.*) http://www.bythedrop.com/e107_plugins/tngIL/getperson.php$1

This looks for all pages with http://www.bythedrop.com/getperson.php? and redirects them to the correct directory http://www.bythedrop.com/e107_plugins/tngIL/getperson.php?.

So when someone hits an old link, they will not get a 404 page, but rather a redirect to the same persons page in the new directory.

Maybe it will come in handy for someone... :wink:

Rush

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...