How to keep the ?error on url if page extension not included?

36
May 26, 2022, at 6:50 PM

I was able to remove the .php or .html extension on my url e.g "localhost/index.php" to "localhost/index" instead. But, on pages with forms, when redirecting back to the form page with the header('Location: /index.php?error=whatever); when there are errors, the ?error=whatever is not included. Like, before it would be "localhost/index.php?error=whatever", but now since I removed the page extension, it just returns to "localhost/index". The error message is not showing up. What I have only done to remove the page extension is via the .htaccess with this code

#turn on url rewriting 
RewriteEngine on
#remove the need for .php extention 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^(.*)$ $1.php

What do you guys think I should or could do to fix this?

READ ALSO
Drupal 8 Entity Query - Condition for an unlimited fields

Drupal 8 Entity Query - Condition for an unlimited fields

With Drupal QueryInterface, it's possible to add a condition on the delta itself by using '%delta' like this :

58
Ho to proper enqueue asset in WP?

Ho to proper enqueue asset in WP?

I have a question and I hope you can help meI am an amateur (quite clear :-) ) trying to enqueue some script

42
Escaping the separator in str_getcsv

Escaping the separator in str_getcsv

str_getcsv("test\\a

91