How to properly configure .htaccess (rewrite)

This is my first question, and all I can say is that I am really happy to be part of this community.

Now, as part of the question. I have a little problem setting my htaccess properly, I tried a lot of lines of code that I found here and there, trying my best to come close to something relevant or close to what I want, but no matter what happens. I failed, I tried to redirect, redirect 301, both with full links and without them, to rewrite the URL with and without the extension, but nothing happened.

So what is my question.

I have a form, when someone clicks the submit button, the form tries to run the file. It creates the following link:

domain.com/api/services/notification/send.php?accept=json&contentType=json&appUrl=http://domain.com 

Although, although I am send.phpunder it api/services/notification/, it is not called at all because there is no extension when the form creates a link, which leads to error 404. So, I tried several times to .htaccessredirect the submission to send.php, but every time I encountered a huge failure. My suggestion; because it is in other letters / words. Basically, I want to .htaccessβ€œreplace” sendwith send.phpwithout affecting the rest of the URL using mod_rewrite.

Any ideas on this? The last code that I was hoping this worked, but not quite, was as follows:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^send?([^/]+) /send.php?accept=json&contentType=json&appUrl=http://domain.com [NC]
+4
source share
1 answer

You can try this rule:

RewriteEngine on
RewriteBase /
RewriteRule ^/api/services/notification/send$ /api/services/notification/send.php [L]
+1
source

All Articles