i KNEW iā€™d find a good use for this domain.

  • AdrianTheFrog@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    Ā·
    edit-2
    30 days ago

    I did some testing for domain redirects, I think the best way to do a redirect (so you can use https) is using your own server (there might be some places that offer free cloud servers too tho)

    first set up a dns record, with a name of @ (the root domain), type of A, and ā€˜dataā€™ with the serverā€™s public ip address. (there might be an easier way to do this on your domain provider, it just needs to direct the domain to your server with a standard webpage configuration, you might also want to set up www to redirect to the root using a CNAME type record, or for this I guess it would probably be faster just to add another type A record to the same server and put server_name xn-blk.gay, www.xn-blk.gay; in the config)

    then install nginx, put the following in the http section in /etc/nginx.conf:

    include /etc/nginx/conf.d/*.conf;
    

    I have the following config for an example redirect server (/etc/nginx/conf.d/test.conf):

    server {
        listen 80;
        server_name test.adrian.place;
    
        # Redirect HTTP to HTTPS
        return 301 https://xkcd.com$request_uri;
    }
    
    server {
        listen 443 ssl;
        server_name test.adrian.place;
        http2 on;
    
        # Redirect all requests to the target URL
        return 301 https://xkcd.com$request_uri;
    }
    

    and then enable and start the nginx systemd service, run certbot to set up https, and then reload the service

    Edit: If itā€™s a home server youā€™ll need to set up port forwarding for 443 and 80 ofc

    • yuri@pawb.socialOP
      link
      fedilink
      arrow-up
      1
      Ā·
      1 month ago

      all my hosting is handled through namecheap right now because i am both lazy and uneducated, BUT iā€™ve been looking into setting up a home server for unrelated reasons! i will absolutely be circling back to this comment ^^

      • Pup Biru@aussie.zone
        link
        fedilink
        English
        arrow-up
        2
        Ā·
        1 month ago

        you can do similar things for free with cloudflare, if you donā€™t have an aversion to using cloudflare

          • Pup Biru@aussie.zone
            link
            fedilink
            English
            arrow-up
            3
            Ā·
            1 month ago

            some people are averse to it because some hugely high percentage of all websites run through it - for privacy reasons, thatā€™s not a good thing - if they enshittify, their data set could be more valuable than metas