I'm trying to improve my php application using Swoole for fetch notifications. As swoole runs in PHP's built in server, I'm trying to redirect my 'host/notification' requests to port 9501 where Swoole is running without success. My code in .htaccess follows below:
# redirect to 9501 if "messages/" is matched
RewriteCond %{SERVER_PORT} !^9501$
RewriteRule ^notification(.*[^/])/?$ https://%{HTTP_HOST}:9501
Is it correct to try to use this approach or since the built in server has nothing to do with Apache that is not possible?
Thanks in advance