You should use a "responsive design" or a "dynamic serving" approach instead of a separate mobile URL redirect. This means that your website will automatically adjust its layout based on the screen size of the device accessing it. This approach is preferred as it provides a better user experience and avoids issues with search engines indexing multiple URLs for the same content. If, however, you must use a separate mobile URL redirect, it's recommended to use the "301 redirect" (permanent redirect) to redirect users to the mobile version of the site when they access it from a mobile device.
The recommended redirect for the mobile version of a site is server-side redirect using the HTTP header "Location" or a "301 redirect". This type of redirect informs search engines that the page has permanently moved to a new location and transfers the user to the new URL while updating the search engine index. This helps maintain your website's search engine rankings and provides a better user experience by automatically redirecting mobile users to the mobile-optimized version of your site.