Sagamore .htaccess

From Parents
Revision as of 17:09, 15 May 2014 by Dave (talk | contribs) (Note about old urls that may still need to be redirected)
Jump to navigation Jump to search

To meet Sagamore online goals 2014#URL_redirects, build out a comprehensive .htaccess file on the server that covers the existing Sagamore Hills PTA website (2011-2014) addresses, as well as addresses dropped from the site that still show up via search (but 404) as determined by checking search engines (via "site:sagamorehillspta.org"). We're leaving out other possible links for now (and will fix on an as-need basis).

  • It's okay for popular links to forward to the same place another link already does or simply dump to the homepage
  • Inlcude non-page (file) links too (when it makes sense)
  • Don't inlcude (unless we find they're used somewhere?):
    • "attachement types" (/?attachement_id=)
    • Comment feeds (/?feed=&page_id=)
    • Other auto-generated content (e.g. comment feeds)
  • List addresses in alphabetical order and thoroughly comment to ease future pruning

Discover links by:

Wordpress recognizes quite a few URLs for the same content. All content can by accessed by its "short link" which uses the post's ID as a query parameter, e.g., /?p=ID , which will 301 to the contents cononical address (unless it's of type "post"). All Wordpress content are "posts" of various "types", such as posts, pages, attachments, etc. Each post type has its own canonical query parameter—"p" for posts, "page_id" for pages, "attachment_id" for attachements—but Wordpress will 301 from any of those to any other, regardelss of post type.

We will start out defining redirects for the cononical addresses only, but see if we can cover the other possibilities with a blanket redirect.

We shouldn't have to deal with URLs collisions with the new site because we'll be starting with never-used Wordpress post_IDs.

# .htaccess
# Sagamore Hills PTA
# http://www.9.0ne.org/w/Sagamore_.htaccess

# Examples
#
# WITHOUT query parameters
# RedirectMatch 301 ^/openhouse$ http://sagamorehillspta.org/?page_id=975
# WITH query parameters
# Match on query string, match on root (/) (and "?" seems necessary?), append redirect url with "?" to avoid appending the matched query string, redirect permanently
# RewriteCond %{QUERY_STRING} ^page_id=975$
# RewriteRule ^/?$ http://www.sagamorehillspta.org/openhouse? [redirect=301]


# Necessary for "RewriteRule"s
RewriteEngine on


# /?p=179
# (old) After-Care Information

# /?p=414
# Math Stars Available Here

# /?p=701
# Annual Reflections Art Competition

# /?p=791
# eBooks and AR Info

# /?p=929
# Dia de los Muertos Festivaal, 5k & Fun Run

# /?p=1003
# Sagamore Rocks! Auction

# /?p=1006
# Sagamore Rocks! Auction Catalog

# /?page_id=17
# History, Mission, Goals (an "About" page)

# /?page_id=19
# Volunteers Needed! (plea with link to old spreadsheet

# /?page_id=24
# Calendar

# /?page_id=26
# Fundraising

# /?page_id=28
# Advertising

# /?page_id=30
# PTA Store

# /?page_id=34
# PTA Board

# /?page_id=36
# Contact

# /?page_id=58
# Parent Resources (collection of links)

# /?page_id=249
# Wellness and Safety

# /?page_id=318
# PTA Enrichment (list of PTA programs/activities/efforts)

# /?page_id=556
# Summer Fun! (list links to summer enrichment resources)

# /?page_id=975
# Open House

# /wp-content/uploads/2011/07/2011-to-2012-Volunteer-Oppy-Form.xls
# Spreadsheet describing volunteer opportunities

# /wp-content/uploads/2011/07/handbook2008-2009final1.pdf
# Old handbook PDF

# /wp-content/uploads/2011/07/Mount-Aconcagua-Math-Mountain.pdf
# /wp-content/uploads/2011/07/Mount-Everest-Math-Mountain.pdf
# /wp-content/uploads/2011/07/Mount-McKinley-Math-Mountain1.pdf
# /wp-content/uploads/2011/07/Sagamore-Hills-Math-Mountain.pdf
# Math Fact Mountains worksheets

# /wp-content/uploads/2011/07/PTA-Funds-Transfer-Form.pdf
# PTA Funds Transfer from (was linked from "Parent Resources")

# /wp-content/uploads/2012/01/Math-Stars-Grade-11.pdf
# /wp-content/uploads/2012/01/Math-Stars-Grade-31.pdf
# /wp-content/uploads/2012/01/Math-Stars-Grade-41.pdf
# /wp-content/uploads/2012/01/Math-Stars-Kindergarten-11.pdf
# Math Stars worksheets

# /wp-content/uploads/2012/06/1st-grade-reading-list.pdf
# Rising 1st Grade Reading List (linked from "Summer Fun!")

# /wp-content/uploads/2012/06/4th-and-5th-Grade-Discovery-Program1.pdf
# 4th and 5th Grade Discovery Program (linked from "Parent Resources")

# /wp-content/uploads/2012/09/Reflections-web-page-info-2012.doc
# Reflections 2012-2013 info

# /wp-content/uploads/2013/09/Registration-Form-w-Waiver-Spanish.pdf
# Dia de los Muertos registration and waiver in Spanish