Giter Site home page Giter Site logo

redirects with parameters about seo HOT 5 CLOSED

ethercreative avatar ethercreative commented on July 18, 2024
redirects with parameters

from seo.

Comments (5)

Tam avatar Tam commented on July 18, 2024 1

Merged in latest release!

from seo.

DanielleDeman avatar DanielleDeman commented on July 18, 2024

Fixed it my adding $path = strtok($path, '?'); to public function findRedirectByPath ($path)

from seo.

DanielleDeman avatar DanielleDeman commented on July 18, 2024

Would you like me to fork the project and push the solution

from seo.

Tam avatar Tam commented on July 18, 2024

Yeah that'd be great, thanks!

from seo.

jamealg avatar jamealg commented on July 18, 2024

I'm encountering this issue still on the latest Craft 2 release. At least if this is the use case:

  1. Set up a redirect from /abc to /xyz
  2. Navigate to /abc?ctm_tracking_code=9929292929
  3. 404 (expected to go to /xyz)

I was able to fix it by adding some code to Seo_RedirectService.php

		$qs = array();
		preg_match('/\?.*/', $path, $qs);
		$path = preg_replace('/\?.*/', '', $path);

		if (trim($redirect['uri'], '/') == $path)
		{
			$to = (count($qs)>0) ? $redirect['to'] . $qs[0] : $redirect['to'];
		}

Not the most elegant but it works. I'm on an older version than the latest Craft 2 release so the code may not be exactly the same but I did confirm the issue on the latest as well.

from seo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.