Sagamore .htaccess: Difference between revisions
(More entries (from Bing)) |
(Cleanup intro) |
||
Line 1: | Line 1: | ||
To meet [[Sagamore online goals 2014#URL_redirects]], build out a comprehensive <code>.htaccess</code> file on [[Sagamore Hills PTA Dreamhost account#Server|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) |
To meet [[Sagamore online goals 2014#URL_redirects]], build out a comprehensive <code>.htaccess</code> file on [[Sagamore Hills PTA Dreamhost account#Server|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"). |
||
* It's okay for popular links to forward to the same place another link already does or simply dump to the homepage |
* It's okay for popular links to forward to the same place another link already does or simply dump to the homepage |
||
Line 6: | Line 6: | ||
** "attachement types" (<code>/?attachement_id=</code>) |
** "attachement types" (<code>/?attachement_id=</code>) |
||
** Comment feeds (<code>/?feed=<var>…</var>&page_id=<var>…</var></code>) |
** Comment feeds (<code>/?feed=<var>…</var>&page_id=<var>…</var></code>) |
||
** Other auto-generated content (e.g. comment feeds) |
|||
* List addresses in alphabetical order and thoroughly comment to ease future pruning |
* List addresses in alphabetical order and thoroughly comment to ease future pruning |
||
Line 11: | Line 12: | ||
* Browsing site content/file listing (Wordpress admin panel) |
* Browsing site content/file listing (Wordpress admin panel) |
||
* Search for "<code>site:sagamorehillspta.org</code>" at search engines |
* Search for "<code>site:sagamorehillspta.org</code>" at search engines (https://www.google.com/search?q=site%3Asagamorehillspta.org) |
||
* See what the [https://web.archive.org Internet Archive] comes up with |
* See what the [https://web.archive.org Internet Archive] comes up with (https://web.archive.org/web/*/http://sagamorehillspta.org*) |
||
'''Wordpress recognizes quite a few URLs for the same content |
'''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., <code>/?p=<var>ID</var></code> , 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 will start out defining redirects for the cononical addresses only, but '''see if we can cover the other possibilities with a blanket redirect'''. |
Revision as of 17:05, 15 May 2014
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").
- 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)
- "attachement types" (
- List addresses in alphabetical order and thoroughly comment to ease future pruning
Discover links by:
- Browsing site content/file listing (Wordpress admin panel)
- Search for "
site:sagamorehillspta.org
" at search engines (https://www.google.com/search?q=site%3Asagamorehillspta.org) - See what the Internet Archive comes up with (https://web.archive.org/web/*/http://sagamorehillspta.org*)
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