[SOLVED] Route ending with .com


First time posting and kind of new to Slim, hope I get this right!

I have a GET route that looks something like:

However, when the email address I pass ends with a “.com”, i hit a 403 forbidden error. This is not the case when it ends with “.ca” or “.org”.

Is this a htaccess redirection issue?

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

Is it recommended to end my routes with a trailing slash?

Thanks for your help!

hi @jfpaquin

try this

in your route or controller

$this->get(‘testEmail/{email}’, function ($req, $res, $args) {
$emailModel = new EmailModel();
return $res
->withHeader(‘Content-type’, ‘application/json’)

in your model


public function testEmail($email)
echo $email;

catch (\Exception $e){
echo $e->getMessage();

and try with any email extension

Hello @hdkcreative !

Thanks for taking some time to answer.

The thing is, if the email extension is “.com”, the route’s function is never called.
I get a 403 Forbidden: You don’t have permission to access /rest/contacts/xxxxx@gmail.com.

This is could very well be a server/htaccess config problem, but I can’t find anything on this kind of issue :frowning:

i try xxxxx@gmail.com in my computer… and this work fine…

you are working in local o cloud ?

Cloud, I’m on a hosted VPS.

It seems to be a ModSecurity settings that’s too strict. Disabling ModSecurity result in the correct response.

ahhh ok .perfect…

remember close this post…

ecxample add the word [Solved] TO TITLE :wink: