Forums

submit redirect to index.php causing problems

BrainDed 25 Feb, 2013
For SEO reasons I have index.php redirecting to domain.com. When you submit a form on my install nothing happens. When I looked at "front end" view I noticed the url has index.php in it. The URL after submiting on front end view, looks like this.. This actually works.

index.php?option=com_chronoforms&chronoform=Contact_Us
index.php?option=com_chronoforms&chronoform=Contact_Us&event=submit

The URL after submiting on live site, does not work, looks like this.

contact-us?chronoform=Contact_Us&event=submit

So it looks like my rules in .htaccess are messing with Chronos.. I'm absolute noob when it comes to those rules and just implemented them from a post at joomla forum I found to resolve duplicate content issues with index.php... Here is the rerwrite rules..


RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(index|home)\.html?\ HTTP/
RewriteRule ^(([^/]+/)*)(index|home)\.html?$ http://www.domain.com/$1 [R=301,L]

RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php$ http%2://www.domain.com/$1 [R=301,L]

# Remove index.php from sub pages e.g. http://www.domain.com/index.php/about --> http://www.domain.com/about
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php/([^\ ]*)\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php/(.*)$ http%2://www.domain.com/$1$3 [R=301,L]



Any thoughts on how I can keep the redirect for all pages containing index.php except for this chornos form? OR... would it be best to alter chronos so it does not use index.php some how?
BrainDed 25 Feb, 2013
If i Set: Relative URL = "NO" it will write to the DB and fire off the emails; however, the thank you message redirects them off the page they are on instead of displaying it within the module.

Redirected to index.php?option=com_chronoforms&chronoform=Contact_Us&event=submit

So, hey at least it is working, but it would be nice if the message just appeared in the modulue instead of taking them to that page.
GreyHead 26 Feb, 2013
Hi BrainDed,

I think that the main message here is don't mess with the site URLs unless you know what you are doing (and I don't, it's mostly a mystery to me).

There is a workaround which has been posted here before and maybe in a FAQ (I don't remember). You can grab the page URL, submit it with the form and then use the ReDirect User action to send the user back to the same page. The trick is to add a flag either in the URL or in the User Session to say that the form has been submitted.

Then you add a check at the start of the On Load event to look for the flag. If it finds it it shows a Thanks message, if not then it shows the form.

Sounds complicated and takes a little working through but it will work.

Bob
BrainDed 26 Feb, 2013
Thanks GrayHead, I will search around for that.

Not messing with URL's in a Joomla environment isn't a real option if you want to avoid Google indexing a bunch of duplicate content or junk, IMO.
This topic is locked and no more replies can be posted.