Testing primers previously designed where restriction enzymes were located in the middle of the primer sequence but not sure whether this is actually possible.
The restriction site can be added wherever you want, but take into account that after digestion the 5´end will be cut. When designing primers it is always better to leave at least 2 bp at the 5´ of the restriction site so that the enzyme can cut better after PCR amplification.
Yes, RE sites can be put into primers away from the ends. It is also worth bearing in mind that there are two other considerations that need to be mentioned.
1) most common restriction enzyme sites are palindromic. If the site within your primer is flanked by further compatible bases near to the 3' end you could promote primer-dimerisation during the amplification step, so the sequence context and position need to be taken into account when designing the primer and locating the restriction site.
2) not only do many restriction enzymes require a number of bases adjacent to them to cut efficiently, but you also need to remember that PCR primers are synthesised in reverse compared to enzymatic 5'-3' processing. This means that if you have a bad batch of primers, their 5' ends may be truncated, meaning you could end up with either not enough flanking base pairs being present for the enzyme to cut well, but additionally, the restriction site itself could be incomplete and completely refractory to digestion. Admittedly this problem has declined considerably over the past 20 years, but I have experienced it on a small number of occasions (it only becomes obvious when you blunt clone the insert out of frustration and then sequence!).
It also depends upon your experiments, you may add it in the end or along with the primer sequence. If you slightly elaboarte, possibly it may appear to be better to add it at the end of the primer.