clirdlf / clir_theme

WordPress theme enhancements
https://www.clir.org
1 stars 0 forks source link

DLF ugly-to-pretty URL problem #144

Closed nowviskie closed 6 years ago

nowviskie commented 7 years ago

We need to make sure link structures redirect properly.

Any hard-coded links to pages/posts like this: https://www.diglib.org/archives/12527/

don't resolve to proper pretty URLs, but rather all wind up pointing to this post:

https://staging.diglib.org/2017/02/15/archives-have-never-been-neutral-an-ndsa-interview-with-jarrett-drake/12527/

waynegraham commented 7 years ago

So I don't have to research for this: https://wordpress.stackexchange.com/questions/257749/will-references-to-ugly-links-automatically-redirect-to-their-pretty-url-permali

nowviskie commented 6 years ago

Still the scariest thing about tonight's launch. These two links don't point to the same post. Should I understand the above to mean "don't worry about it?"

https://www.diglib.org/archives/14053/ https://staging.diglib.org/archives/14053/

waynegraham commented 6 years ago

I'm punting on this for today and using the /archives/%post_id%/.

When I did this, however, the entry 14053 doesn't appear to exist. Digging in to it.

waynegraham commented 6 years ago

The IDs are for the blog apparently.

https://staging.diglib.org/archives/14585/ https://www.diglib.org/archives/14053/

nowviskie commented 6 years ago

So -- sorry to be dense, but what's the upshot?

waynegraham commented 6 years ago

Post IDs are off by 532; trying to determine if this is consistent throughout. I've got some ideas on how to fix this in the database or with rewrite rules, but need to understand more of what's going on here.

nowviskie commented 6 years ago

Thanks, Wayne.

There were also lots of pages (not posts, those were properly sync'd) that were either new or had changes since the last import. As I was going through everything we link to at the top level anyway, I just identified and updated those manually this weekend, so as not to bug you. In a few cases, this required me to create a page fresh, that hadn't been ported over from the old site. If those create problems due to id's, I guess we can catch them with the broken link checker, which we need to pay attention to, anyway.

nowviskie commented 6 years ago

Pages (as opposed to posts) seem generally okay, though, as they had the pretty URLs already.

waynegraham commented 6 years ago

After a few false starts, implemented redirects on the %post_name% variable (https://gist.github.com/waynegraham/637148a9d6f23d308004f6bf40c6b118).