Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How can I redirect to a URL where the sub-directories can be different?

Avatar

Avatar
Validate 1
Level 2
kens48669563
Level 2

Likes

6 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
kens48669563
Level 2

Likes

6 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
kens48669563
Level 2

08-08-2018

Hi all!

Here's my dilemma...

I have a url that looks like this: domain.com/search/x-[something]/y-[something]

I want to redirect anything with /search to /search?param=xyz, while still including the sub-directories. Like /search/x-[something]/y-[something]?param=xyz.

Any advice as to how I can basically wildcard the redirect?

thanks!

Replies

Avatar

Avatar
Boost 50
Employee
tanvia28417128
Employee

Likes

73 likes

Total Posts

61 posts

Correct Reply

8 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Boost 50
Employee
tanvia28417128
Employee

Likes

73 likes

Total Posts

61 posts

Correct Reply

8 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 10
View profile
tanvia28417128
Employee

09-08-2018

kens48669563

You can try redirecting through the Target inbuilt redirect feature and mention the complete URL with parameters to redirect on

Redirect to a URL

Avatar

Avatar
Validate 1
Level 2
kens48669563
Level 2

Likes

6 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
kens48669563
Level 2

Likes

6 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
kens48669563
Level 2

09-08-2018

Right but the problem is that the subdirectories in the URL will change. Everything after the /search/ is variable.

Avatar

Avatar
Boost 5
Level 2
DaveDigital
Level 2

Likes

18 likes

Total Posts

13 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile

Avatar
Boost 5
Level 2
DaveDigital
Level 2

Likes

18 likes

Total Posts

13 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile
DaveDigital
Level 2

23-11-2018

Hi Kens,

So I understand correctly  - you are not necessarily wanting to redirect to a completely different page, but basically add a parameters to the same page, and reload?

Instead of trying the in-built redirect feature, this could be done with some simple javascript to add the parameter.

There are a few ways to achieve this but a short way that might be suitable for your test case is this custom code:

window.location.search += '&param=xyz';

i see it has been a few weeks since you posted, so hope this helps.  I'm unsure if this approach would introduce any reporting concerns but i guess might affect page view numbers if both the initial page and destination page view are recorded.

Avatar

Avatar
Boost 50
Employee
ryanr701
Employee

Likes

188 likes

Total Posts

193 posts

Correct Reply

77 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 100
View profile

Avatar
Boost 50
Employee
ryanr701
Employee

Likes

188 likes

Total Posts

193 posts

Correct Reply

77 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 100
View profile
ryanr701
Employee

28-11-2018

Hi Kens,

I think Dave's solution is the right path. You'll want to use a custom code script to handle the redirect rather the the out-of-the-box redirect option per your mentioned criteria.

Your specific use case will require a template rule, an audience, and custom code redirect script.

  1. Template rule: use OR when page path contains "/search/"
  2. A custom code script (add custom code type modification via modification pane - open with code icon in upper right of editor)
    1. Like Dave suggested:
  3. On step 2 for the targeting you want to create a custom audience that for people who's current page url does NOT contain "param=xyz" to prevent those people from entering a continuous loop.