Jump to content

shaggytail

Members
  • Posts

    3
  • Joined

  • Last visited

shaggytail's Achievements

Newbie

Newbie (2/6)

0

Reputation

  1. $this->addHookBefore('ProcessPageView::execute', function(HookEvent $event) { // Get the object the event occurred on, if needed $process = $event->object; $actual_link = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; echo $process->getPage()->httpUrl; if($actual_link !== $process->getPage()->httpUrl) { header("HTTP/1.1 301 Moved Permanently"); header("Location: ". $process->getPage()->httpUrl); exit(); } }); This is what I ended up implementing, not sure if it's the proper way but it works.
  2. So far I've tried to make a hook using Page::url, Page::path, wireHttp::, session::, none of which worked.
  3. Hi, we're running into an issue where both lowercase and uppercase versions of our urls are being indexed Example a): website.com/hello/this-URL/ Example: b) website.com/hello/this-url/ This occurred because some of our content was linking to example A. We have since corrected all internal links within our website to link to example B. According to some research, this is often done via apache settings but our website uses case sensitive files "exAmple.jpg" "formCustomer.php" so doing that would make these files invalid. Overhauling our website to satisfy the apache fix would require many many man hours. Is there a way to do this within Processwire's core, something like strtolower urls then proceed. Thanks. Been a ProcessWire user for 7 years I love it, use it daily.
×
×
  • Create New...