Joomla 5 Notice

We are pleased to announce that as of January 29, 2024, all of our Joomla extensions are compatible with Joomla 5.

For all who are still updateing from Joomla 3 to Joomla 4: Joomla 4 Migration instructions are available here:

There is now a separate Documentation for Visforms for Joomla 4 and for Visforms for Joomla 5!

Forum

Visforms Subscription user can ask questions in our forum. Please log in with the relevant user first.
Everybody can access the forum for reading.

Please only ask 1 question per topic.

Redirect on submit doesn't respect site root?

More
3 years 3 weeks ago #7348 by sjb1963
So, I build websites in a sandbox. That means every site (in development) is a subfolder of the document root. That's all good because it's also set in .htaccess

The problem is, when I set the form to redirect - anywhere - it ignores the directives and goes straight to the document root. Example

Document root = " www.sandbox.com "
Site root = " www.sandbox.com/site1 "

So, what is happening is - after submission, I get the "this may take a few moments" message, then I am directed back to "document root", not to "site root"

I don't really want to redirect people after submission, but I would like it to work.

I have a sense that I'm missing something, but I haven't found it in the docs or on the forum.

Any help would be appreciated.

More
3 years 3 weeks ago - 3 years 3 weeks ago #7349 by Administrator AV
Replied by Administrator AV on topic Redirect on submit doesn't respect site root?
How did you set this in .htaccess?
If you are talking about the "RewriteBase" in the .htacces, this does not change which directory is considered the root directory.

Here is how I understand it:
When working with URL's and URL parts, there is no distinction between a document root and a site root.
As long, as you access your sandbox website using an URL that starts with the domain sandbox.com the root of the website is always the sandbox.com
It is the server settings that maps directories to URL's (domains).
The root of a website is always detected via the domain part of the URL which is the same for both URL's in your set up (sandbox.com)
So actually the physical location of the files (in a subfolder or a sibling) does not matter that much.
And the path segment of the URL (after the domain) has no implication on the detection of the root.

Visforms uses the root for it's redirects after the form was submitted.

I think the problem would be solved, if you would configure your sandbox as a subdomain ( www.site1.sandbox.com )
I think using the redirect option "return to previous page" should work, too.

Regards,
Aicha

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
Last edit: 3 years 3 weeks ago by Administrator AV.

More
3 years 3 weeks ago - 3 years 3 weeks ago #7350 by sjb1963
Replied by sjb1963 on topic Redirect on submit doesn't respect site root?
Hello,
I must not be being clear on what I have: 
I have a sandbox.com domain with a root page that is blank. This is where I am being redirected to. I should not be.

I have:
sandbox.com
sandbox.com/site1
sandbox.com/site2

I used Admin Tools to manage the htaccess on my sites. 
In the "HTACCESS Builder", there is a setting that says: Base directory of your site (/ for domain's root):

For each site, it has their subfolder name: i.e. /site1, /site2 etc.

There is no special server setup. My server resolves to "sandbox.com". I installed each site in a subfolder of that domain. You can surf down as far as you want in any of those sites, and when you click the home button, you will be redirected to that sites home page. Nothing special at all. This has worked for well over a decade. 

So I am more inclined to believe it's simply a settings problem. I just don't know where it is, or how to set it. I've tried to search and I have read the documentation. I have seen the fields that indicate a place to tell it to redirect, or not, and the associated on/off options. None of these work. 

Now, I'm actually on sandbox.com/site1/contactus-form
I enter the information, and I expect to be returned to the same page ( sandbox.com/site1/contactus-form ). I am not. I am taken to  sandbox.com/
  • If I leave it blank (which implies "stay on the same page and display the result message), it redirects to sandbox.com, not sandbox.com/site#
  • When I specify a redirect page or site in the redirect field i.e. sandbox.com/site1, I am again redirected to sandbox.com
I don't want (in this case) the page to redirect at all. I would like it simply to display the simple success message and stay on the same freaking page. Simple, or so I once thought.

I do believe being able to redirect to other pages depending on user input would be interesting, but for now, I just need to figure this part out.

Thank you for your help.
Last edit: 3 years 3 weeks ago by sjb1963.

More
3 years 2 weeks ago #7352 by sjb1963
Replied by sjb1963 on topic Redirect on submit doesn't respect site root?
This remains a critical issue.

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum