I have centos7 dedi with latest whm/cpanel install I’ve enabled access to user dirs without domains example http://ip/~user but my target is to be http://ip/user
Now my question would be is it possible to remove ~ and how…?
Googled a lot and read a lot but didn’t found answer…
2
Answers
You might try this:
Warning: the above will rewrite every url to ~url regardless of if the user exists, so if you go to
http://IP/exampleurl
it will rewrite that tohttp://IP/~exampleurl
, It only checks if a file or a directory exists there.You really should use your hosts file instead of mod_userdir if you’re trying to view a site before updating the DNS, or before you have a domain for it.
I can guarantee that mod_userdir will always end up being the unnecessarily difficult solution for this.
This is a guide for using your hosts file instead of mod_userdir:
https://docs.cpanel.net/knowledge-base/dns/how-to-modify-your-hosts-file/