Forms not working after adding .htaccess rule

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
kevindef
 
 
Posts: 162
Joined: Fri Aug 11, 2017 3:37 am

Forms not working after adding .htaccess rule

Post by kevindef »

Hello there,

Just wanted to check if anyone else have experienced the same issue of forms not working soon after adding the code to hide .html and .php page extensions inside the .htaccess file?

Not sure if there's a correlation between the two; .htaccess rule scrip and the contact forms behaviour. Inside the form; " use built-in PHP from processor script" was selected. The code hid the page extensions with no other issues other than the forms not working.

Any reasons, ideas, tips, hints, suggestions are all welcome.

Here's the code:

RewriteEngine On
RewriteCond %{HTTP_HOST} labourhub\.com\.au [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://labourhub.com.au/$1 [R,L]

RewriteEngine On
RewriteCond %{THE_REQUEST} /([^.]+)\.php [NC]
RewriteRule ^ /%1 [NC,L,R]

RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [NC,L]

RewriteEngine On
RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ /%1 [NC,L,R]

RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^ %{REQUEST_URI}.html [NC,L]
User avatar
Pablo
 
Posts: 21699
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Forms not working after adding .htaccess rule

Post by Pablo »

Maybe the code causes the server to no longer process the PHP script?
kevindef
 
 
Posts: 162
Joined: Fri Aug 11, 2017 3:37 am

Re: Forms not working after adding .htaccess rule

Post by kevindef »

Mmmm....in that case I might add a .htaccess skip rule for POST requests to allow forms submitted and give it a try.

Thanks Pablo, let me see how that goes.
Post Reply