1

I am working on 2 servers and .htaccess file working on 1 server but not working on second server.

.htaccess file

RewriteEngine On
RewriteRule ^socket.io/(.*)$ ws://example.com:3000/socket.io/?$1  [P,QSA,L]

I am working on socket, so i dont want to show :port in url, so i just redirect url to port within htaccess

Url examples server 1,

ws://example.com/socket.io/etc Redirect ON ws://example.com:3000/socket.io/etc (working)

http://example.com/socket.io/etc Redirect ON ws://example.com:3000/socket.io/etc (working)

But on server 2, same code on different domain return "Internal Server Error"

I dont want to change my code, because it is my backup server, so i want to run same code, but what i am missing? Is there any apache extension required or what i am missing?

4
  • If you get "Internal server error", there should be an entry in apache error log with more info Commented Apr 4, 2020 at 21:59
  • Error in Apache log: AH01144: No protocol handler was valid for the URL /socket.io/ (scheme 'ws'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. Commented Apr 5, 2020 at 10:27
  • Looks like you need to enable mod_proxy_wstunnel Commented Apr 5, 2020 at 12:32
  • Problem solved, Here: stackoverflow.com/a/53523424/11959017 Thanks Commented Apr 5, 2020 at 16:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.