-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Website Redirect: Issues in Apache and Nginx #634
Comments
So the problem is that we don't have good support on that page for doing a redirect to another URL on the same domain uisng the same protocol, which is a little surprising! I'll need to do some work to fix this properly ... |
Jamie, did you have chance to have a look at this? |
I'm still working on it - will update this bug when it's done.. |
Ok, please check out the latest commits and let me know how it works for you now ... |
It doesn't solve the initial problem, i.e. redirect loop, when creating a redirect from Also, I tried both options of
and this is how it looks with the second options:
.. both create redirect loop. |
Oh, so what we really need is a new option to only match the specific path in the redirect. |
I would like it to work without any options. We should exclude the path on root, i.e. |
Ok with the latest set of commits, the user can choose how sub-directory redirects work so that a redirect of / doesn't cause a loop. |
Alright! I can see now that you added another option called Ignore sub-directories. It works now as intended with However, there is still one bug left in Nginx module. If I use
However, it is not detected by Virtualmin and you cannot set it or change it in the UI anyhow .. |
The latest commit to the Nginx module should fix this... |
Alright, great! Thanks! Now as the final stroke, can we make Auto option for Redirect sub-directories to? For example Also, why we assume that if a user makes redirect for |
Maybe we could display an error if the user creates a redirect that would cause an infinite loop? |
I think this would be a good addition as well. But still that Redirect sub-directories to? is way to complicated, even though useful and powerful. |
I'll add that check .. |
Hi both, Has there been a release that includes these changes? I'm still having problems redirecting a Thanks, Paul |
@pixel-paul what problem are you seeing exactly? |
I'm now running Virtualmin 7.9.0 and I still cannot get non-www to redirect to www. Note I am using This is the redirect requirement:
If I create a rule as follows: I get a redirect loop. After it is added, I cannot see the entry in the Virtualmin Website Redirects UI, however I can see it is added in the nginx conf as:
I have multiple rewrite rules, so could this be an
|
I don't think we have released Nginx plugin yet. If you apply the latest code from virtualmin/virtualmin-nginx, does it work then? |
Hello, Jamie. I suggest we fix these last issues before finally making Virtualmin 7.8 release.
The issue number 1 that manifests in both Nginx and Apache.
# 1 Setup Example:
Created redirect, even though Include sub-paths in redirect is enabled doesn't include it in redirect, i.e. on the configs (Apache and Nginx) the redirect looks like
https://google.com/
rather thanhttps://google.com/$1
. We can manually set it up in the UI to redirect tohttps://google.com/$1
but this is not user friendly.The issue number 2 is redirect loop that happens (again in both Apache and Nginx) when source URL path is set to
/
and the redirect happens inside of the same domain.# 2 Setup Example:
So, if a user wants to redirect the root of the site to some dir it won't work.
Created redirect line in Apache is:
.. what would work in this example is:
In case we use alternative setup, i.e. using URL at this website option instead, e.g.:
.. then the redirect loop still happens. Created code in Apache config is:
.. while working example is:
Issue number 3 - Explanations for Include sub-paths in redirect needs a fix, as the logic seems completely reversed, e.g.:
This first part
When this is set to Yes, the sub-directory
should beWhen this is set to No, the sub-directory
. The second paragraphIf No was selected in this example
should beIf Yes was selected in this example
.. The very last paragraphHowever, if Yes is chosen you can use the special code $1 in the destination URL.
shouldn't even exist as we should add $1 automatically and not complicate things for the user.It has to be intuitively clear what's happening. If a user needs to refer to the documentation, then we do something wrong in the UI ..
The text was updated successfully, but these errors were encountered: