• Resolved couchwood

    (@couchwood)


    Hello,

    We really enjoy your plugin, thank you! We are using it in a development site now and we can’t get the redirects to work with our WordPress Site URL unless we add in an extra folder to the redirects.

    Site URL (WP Admin -> Settings -> General): https://casper.zionandzion.com/~salonsby

    Redirection Example:
    Source URL: ^/tester[/]?$
    Target URL: /contact/

    We’d like for https://casper.zionandzion.com/~salonsby/tester to redirect to https://casper.zionandzion.com/~salonsby/contact/ (we’d do real ones eventually, but this is an example we’re trying to flush out), but we can’t get it to work without adding in the additional “/~salonsby” to the Source URL portion. We don’t recall having to do this on other sites. This URL structure will not be on the live website, but we prefer to test all URLs before going live. Is there a way to ensure that the entire Site URL is used, or add to the URL via a function?

    Cache has been cleared and this is Twenty Nineteen theme with just Redirection plugin turned on in debugging mode with Health Check & Troubleshooting plugin.

    Let me know if I can assist, thanks

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author John Godley

    (@johnny5)

    So the redirect is working? Your source needs to be relative to the site root, so will need to include the full path.

    Thread Starter couchwood

    (@couchwood)

    No, the redirect is not working. Here is what we understand should happen that is not working:

    Add Site URL:
    https://casper.zionandzion.com/~salonsby

    Plus redirect regex:
    ^/tester[/]?$

    Equals this URL to look for (either with or without ending slash):
    https://casper.zionandzion.com/~salonsby/tester

    But it never works unless we add in “/~salonsby” to our redirect regex, even though that’s already in the Site URL

    Plugin Author John Godley

    (@johnny5)

    As I said, your source needs to be relative to the site root – this is /. You will need to include the full path.

    Thread Starter couchwood

    (@couchwood)

    Appreciate the quick response! I am unsure if I’m explaining clearly what the site root is.

    Site root:
    https://casper.zionandzion.com/~salonsby

    We used a folder inside our domain name to build this development website. If you were to go to https://casper.zionandzion.com/~salonsby/ you can see the website, but if you go to https://casper.zionandzion.com/ you would see nothing. Does Redirection only look for the domain name instead of the Site URL? Can we use folder structure for the relative path? If this is the not the case, can we adjust the plugin with a function to take the development folder path into account?

    Thanks!

    Plugin Author John Godley

    (@johnny5)

    Redirection looks at URLs, not what you have configured in WordPress for your site.

    The root is /, the domain is casper.zionandzion.com, and /~salonsby is just part of the path. Any redirect you create has to match that path.

    ^/tester[/]?$ is saying ‘match a URL that starts at the beginning with /tester‘ – this does not match /~salonsby/tester as tester is not at the start of the path.

    Therefore you will need to include /~salonsby in your source URL. You’ve already said this works so it seems like you’ve solved the problem.

    Incidentally, your match can be made without the regular expression.

    Thread Starter couchwood

    (@couchwood)

    Alright got it, thanks! Have a good rest of your week

    I face the same exact thing, my company works as @couchwood’s company where we have sub folders for the websites we build but the approach that we use is as @johnny5 specified.

    I’ve always wondered if there would be a way to get the redirection plugin to take the WordPress site url to create the redirects, like if you have a relative path then it would assume that you want to use the WordPress base url, if you put something like “https://www.google.com” then it will skip the WordPress base url and use the whole url to redirect.

    It would be nice to have that kind of approach on the plugin but I don’t know how hard would it be to include something like that. Meanwhile we will continue to use it with the sub folder path on the redirections.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Entire Site URL not working’ is closed to new replies.