Access to personalized scripts

Hello. Awesome tool! Loving it.

Question: I have some home made PHP scripts (contact form, sign up, questionaire,…) that I have already coded in the past. As I am migrating to GRAV, my AJAX calls can’t seem to reach the scripts that I placed in my themes directory.

Ex: I have a script

/user/themes/myTheme/scripts/contactForm.php

But my AJAX request gets a 404. I tried adding a custom Redirect/Route, like so

Custom Routes
/script/contact    |    /user/themes/myTheme/scripts/contactForm.php
--
Still no luck. 

Thanks in advance for your help.

I would strongly advise you to convert your php scripts into Grav plugins. Ajax is natively supported by Grav by returning data as json. You can see an example of this in the simplesearch plugin, and we’re using it actively in the learn2 theme for example.