• Resolved 01labs

    (@01labs)


    Hi!

    I am using the Juniper theme and I can’t get it to include the “?redirect_to=random” as the end of the page url. I saw another support ticket where this could be added to eliminate the “?”, where do I insert this code?

    $permalink = get_permalink( $default_redirect_to ).’?utm_source=xy’;

    Sorry, WordPress newbie here! I appreciate all the help!

    Mark

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Christoph

    (@camthor)

    You mean, if your blog address is http://www.example.com and you use for example http://www.example.com?redirect_to=last, it does not go to the last post? What exactly is the expected result? Where do you want to use the link and which post do you want to show?

    $permalink = get_permalink( $default_redirect_to ).’?utm_source=xy’;
    only helps to add a new parameter to the final URL, if no post could be found with the search parameters and therefore the redirect goes to a default post instead. I think that’s not what you need.

    Plugin Author Christoph

    (@camthor)

    If the question is about where to insert the link: You could go to Admin->Appearance->Menus, there you create a new menu entry of type “Custom Link” and use as URL “?redirect_to=random”.

    Thread Starter 01labs

    (@01labs)

    Thank you for your prompt response. Sorry for the vague description. I tried to change the format of the permalinks in the Juniper theme to accommodate the “?redirect_to=random” but it changed it to “redirecttorandom”. I tried to use the default permalink but it only inserted a page number.

    So then I saw this post that said that you can insert the code so you won’t need to insert the “?” in the permalink.

    From your last reply it looks like I can create a new custom permalink to include the “?redirect_to=random”. Is that right?

    Thank you again for all your help!! I’m sure this is WP 101 stuff.

    Plugin Author Christoph

    (@camthor)

    Is your website already accessible so that you could post the address here?

    Changing the format of the permalink – you mean in Settings -> Permalink? I think that is the wrong place. The permalink is the format of links of individual posts (and archives). You decide there if you want to have there parts of the publishing date etc. It is not the place for a redirection – therefore the name permalink.

    This plugin works differently:

    1. A visitor goes to a URL that is the URL of your blog (or a page on it), plus appended “?redirect_to=random” (or something else at the end)
    2. The plugin turns that URL into another one, depending on that “redirect_to” parameter. In your case, the URL of a random post. (Actually, that now is a permalink.).
    3. The visitor will be redirected to that post (through its permalink), and only now the theme becomes active.

    So the first step you need to check, if you type the address of your blog (e.g. the home page) into a browser, append “?redirect_to=random”, press return, if it now goes to a random post. Please check and confirm, or post the blog address here.

    Then, if that works, you want to supply that modified link to your visitors. You could

    • Send it to them by email
    • Add a menu item, as described above
    • Simply enter it as a link behind a text or a button
    • Do some complicated PHP stuff that results in that link

    I tried now the Juniper theme, and it does not remove ? from links. Here all works as expected. So, where exactly did you use the link with the “?redirect_to=…”? In a post? In a page? In a menu?

    PS: You cannot create a new custom permalink to include the “?redirect_to=random”. If the permalink would contain a redirection, then the resulting permalink would again redirect, never ending.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cannot change permalink’ is closed to new replies.