PagePathHistory class

Keeps track of past URLs where pages have lived and automatically redirects (301 permanent) to the new location whenever the past URL is accessed.

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the PagePathHistory class also inherits all the methods and properties of: WireData and Wire.

Show class?             Show args?        

Common

NameReturnSummary 
PagePathHistory::addPathHistory(Page $page, string $path)
boolAdd a history path for a page 
PagePathHistory::deleteAllPathHistory($page)
(nothing)Delete all path history for a given Page or for all pages 
PagePathHistory::deletePathHistory(Page $page, string $path)
intDelete path entry for given page and path 
PagePathHistory::getPage(string $path)
Page NullPageGiven a previously existing path, return the matching Page object or NullPage if not found. 
PagePathHistory::getPathHistory(Page $page)
arrayGet an array of all paths the given page has previously had, oldest to newest 
PagePathHistory::getPathInfo(string $path)
arrayGet array of info about a path if it is in history 
PagePathHistory::getRootSegments()
arrayGet all root segments 
PagePathHistory::isRootSegment(string $segment)
boolIs/was given segment ever a root segment? 
PagePathHistory::minimumAge int 
PagePathHistory::rootSegments array bool 
PagePathHistory::setPathHistory(Page $page, string $path)
boolSet a history path for a page and delete any existing entries for page’s current path 
PagePathHistory::upgrade(int $fromVersion, int $toVersion)
(nothing)Upgrade PagePathHistory module schema

Additional methods and properties

In addition to the methods and properties above, PagePathHistory also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.244

Latest news

  • ProcessWire Weekly #559
    The 559th issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 25 January 2025
  • ProcessWire 3.0.244 new main/master version
    ProcessWire 3.0.244 is our newest main/master/stable version. It's been more than a year in the making and is packed with tons of new features, issue fixes, optimizations and more. This post covers all the details.
    Blog / 18 January 2025
  • Subscribe to weekly ProcessWire news

“The end client and designer love the ease at which they can update the website. Training beyond how to log in wasn’t even necessary since ProcessWire’s default interface is straightforward.” —Jonathan Lahijani